[Lazarus] Where to define conditionals for FPC

Sven Barth pascaldragon at googlemail.com
Fri May 8 19:51:25 CEST 2020


Bo Berglund via lazarus <lazarus at lists.lazarus-ide.org> schrieb am Fr., 8.
Mai 2020, 18:03:

> Maybe I can just enclose the ifdef's in an outer layer ifdef DELPHI?
> Does the converter skip such sections during the conversion?
> Like:
>
> {$IFDEF DELPHI}
>   {$IFDEF USE_SUPERPRO}
>     Sentinel,
>   {$ENDIF}
> {$ENDIF}
>
> Then Sentinel will only ever be used if built by Delphi and only if
> SUPERPRO is set, right?
>

I don't know how the converter works, so I can't tell whether any of this
will help.

However Delphi does not define a DELPHI define, so you'll have to use a
negated check for FPC instead. In your example:

{$IFNDEF FPC}
  {$IFDEF USE_SUPERPRO}
    Sentinel,
  {$ENDIF}
{$ENDIF}

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200508/789c359a/attachment-0001.html>


More information about the lazarus mailing list