$IFDEF with multiple symbols?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

$IFDEF with multiple symbols?

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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: $IFDEF with multiple symbols?

Jonas Maebe-3
On 02/03/17 20:39, Bo Berglund wrote:
> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Loading...