[fpc-pascal] sizeof(Enumerated type in Delphi 5) <> sizeof(The same type in FPC)

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Sep 30 14:23:53 CEST 2013


On 30 Sep 2013, at 14:18, Dennis Poon wrote:

> In Delphi 5,
> var
>  G  : TAutoRefreshFlag;
>
> //where type TAutoRefreshFlag = (arNone, arAutoInc, arDefault);
>
> sizeof(G)  returns 1
[snip]
> This different behaviour break some code when I port them from  
> Delphi 5 to FPC.
>
> Is there a compiler directive I can do to ensure compatibility?

{$mode delphi}

Or, if you want to have that behaviour in an FPC mode, {$z1} or  
{$packenum 1}


Jonas



More information about the fpc-pascal mailing list