[fpc-pascal] List pre-defined defines

Mattias Gaertner nc-gaertnma at netcologne.de
Tue May 16 23:53:45 CEST 2017


On Tue, 16 May 2017 14:45:42 -0700
Jon Foster <jon-lists at jfpossibilities.com> wrote:

> I've looked several times over the years for a way to get fpc to dump all 
> of the predefined "defines" for the target selected. Things like "fpc", 
> "linux", "unix", "android", "cpuarm", "cpui386", ... and who knows what 
> else. Seems like there ought to be an "-i?" switch for this. Have I just 
> missed it? Is there something to dump all of the built in defines for the 
> current target?

touch mytest
fpc -vc mytest

 
> I have a couple of needs for this:
> 
> 1. A "menu" of sorts to figure out which is the best define to make my code 
> adapt to a given target, like when I wrote something for i386 and then 
> discover I need to do something different for x64 or arm.

Lazarus completion box inside an $IFDEF shows the above macros.

 
> 2. I have tools to extract code sections from Pascal sources. but I don't 
> always know which ifdefs to follow.

Lazarus source editor shows inactive $IFDEF regions.

 
> 3. Just 'cause I'm curios... I guess that's more than 2. :-)

Mattias



More information about the fpc-pascal mailing list