[Lazarus] Unicode branch

Michael Van Canneyt michael at freepascal.org
Wed Jun 12 14:18:38 CEST 2013



On Wed, 12 Jun 2013, Michael Schnell wrote:

> On 06/12/2013 01:35 PM, Michael Van Canneyt wrote:
>> 
>> 
>> 
>> Add
>> 
>> {$IFDEF FPC}
>> {$DEFINE UNICODE}
>> {$ENDIF}
>> 
>> to your source, or, alternatively, fpc -dUNICODE
>> 
>> Both do the trick.
>> 
>
> I'm not sure if this is the trick requested, as the target is to 
> automatically modify their source code in a way that it works on the compiler 
> used.

It is bad practice to rely in code on the defines defined by the compiler.

Most component suites have an include file that creates a set of defines based on more or less known version defines.

{$IFDEF VERXYZ}
{$DEFINE THISORTHATFEATURE}
{$ENDIF}

The code then uses THISORTHATFEATURE in code to distinguish between various 'features'.

Your programmers should do the same.

In each case, FPC will not define the same defines as Delphi.

Michael.




More information about the Lazarus mailing list