[fpc-pascal] FPC macros

leledumbo leledumbo_cool at yahoo.co.id
Sat Nov 29 18:48:00 CET 2014


> for several Pascal headers for C libraries it would be very nice, when
macros defined in the interface section would be globally avaible.

It won't, it will be nice for your only particular case (save typing). See
point #2 of http://freepascal.org/faq.var#extensionselect

> But since they are not avaible in other units, these translation have to
> be in an external *.inc file, which have to be included in every unit want
> to use these macros. This is quite disgusting imo.

IMO the use of macro itself, in your case, is already an abuse. If it's only
to name '?mat.name', then a const is better. But I guess this is only to
shorten writing multiple parameters, which is not a good reason since it
compromises ease of reading (misguess the real number of parameters). FPC
preprocessor is not as sophisticated as C/C++ and it's designed as such to
disallow abuses. If you insist, please use external preprocessor instead.



--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/FPC-macros-tp5720549p5720550.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list