On Mon, Oct 16, 2017 at 3:36 PM, Darius Blaszyk <dhkblas...@zeelandnet.nl>
wrote:

> Here's an interesting one. In C I have this code:
>
> #define ID1 MAKE_ID('A', 'B')
>
> Where MAKE_ID is a macro that depending on the endianness of the target
> will create either AB or BA.
>
> The only issue with the following approach
const
  ID  ={$IFDEF ENDIAN_LITTLE} 'AB' {$ELSE} 'BA' {$ENDIF};

is if MAKE_ID is used anywhere else, you'll have to repeat the code.

thanks,
Dmitry
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to