[Lazarus] Where to define conditionals for FPC

Marc Weustink marc at dommelstein.nl
Sun May 10 14:37:12 CEST 2020

On May 8, 2020 6:03:00 PM GMT+02:00, Bo Berglund via lazarus <lazarus at lists.lazarus-ide.org> wrote:
>On Fri, 8 May 2020 17:19:30 +0200, Sven Barth via lazarus
><lazarus at lists.lazarus-ide.org> wrote:
>>Such an include file would need to be included in all units where a
>>might be needed.
>>Alternatively if you always use LazSerial for FPC/Lazarus you could
>>check with "$ifdef FPC" instead.
>Well LazSerial was just an example...
>I am going over the code to remove functionality that has been
>outdated over the years and uses components that are hard to port.
>I have created a bunch of conditionals which I can use to select or
>block certain functions in the code. I have also at the same time
>added the conditionals for FPC to switch between for example LazSerial
>and the corresponding serial component in Windows (there are actually
>two that can be selected between using another conditional in
>All of this works OK in Delphi 2007 when I use the GUI to set the
>conditional variables.
>But what is worrying me is that the Lazarus Delphi Converter will not
>find these conditionals and then convert stuff that are to be Delphi

The last weeks, since I'm working from home, I've been converting a lot of our Delphi 6 projects. I only use the convertor to get a Lazarus project from a dpr. All other changes I revert. The convertor breaks more than it fixes. Like in your case we still release our software build by Delphi. Once I have the lpi, I never use the convertor again. So it cannot touch defines and such.


More information about the lazarus mailing list