Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-03

$IFDEF with multiple symbols?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

Can I use this to make a conditional compilation?

{$IFDEF charlie, oscar}
  main,
{$ENDIF}

Where I want main to be included if one or both of charlie and oscar are defined symbols.
So in effect the condition triggering main would be charlie OR oscar..

If not then how else should I include main in the charlie or oscar case but not if both are undefined?

The problem comes from making some units shared between different projects...

Bo Berglund Developer in Sweden
Jonas Maebe
to Bo Berglund
Bo Berglund wrote 9 lines
Can I use this to make a conditional compilation? {$IFDEF charlie, oscar} main, {$ENDIF} Where I want main to be included if one or both of charlie and oscar are defined symbols. So in effect the condition triggering main would be charlie OR oscar..
{$if defined(charlie) or defined(oscar)}
main,
{$endif}

Jonas