[LCP]#defines to know Endianness

John Navil Joseph navil at emuzed.com
Thu Jul 1 15:05:01 UTC 2004


Hi,

Is there any predefined macros (#defines like  __cplusplus) that the
compiler defines so as to know the endianess of the machine that the
compiled code is to run on?

I want to make my code portable, something like this..

#ifdef __BIG_ENDIAN
	...
	...
#else
	...
	...
#endif

TIA,
John



More information about the linuxCprogramming mailing list