> On 12 Sep 2012, at 19:11, Johann Glaser wrote:
>
>> Can I translate this 1:1, i.e., define an Enum in Pascal and just ignore
>> the compiler warnings about reused values?
>>
>> Or should I rather define all these types as Integer and define
>> constants for all values?
>
> It depends on whether you need arithmetic or not. If you do, use integer 
> constants, otherwise you can use an enum.

Actually you cannot.  FPC optimizes enumerations in some cases (i.e.
in Delphi mode) but GCC uses 32bit for enumerations alwais.

Anyway you can still use enums, but telling to FPC that you want to
set its size by directives $PACKENUM and $ENUMSIZE.

Guillermo "Ñuño" Martínez
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to