User level Macros for Endianess

Jesper Skov jskov at cygnus.co.uk
Wed Jan 12 20:11:03 EST 2000


>>>>> "iweiny" == iweiny  <iweiny at pacbell.net> writes:

iweiny> What Macros should I be using to key off of for this?  I have
iweiny> looked through /usr/include/endian.h and
iweiny> /usr/include/bits/endian.h.  BYTE_ORDER (without the leading
iweiny> underscores) is only defined if __USE_BSD is defined.  BOTH
iweiny> __BIG_ENDIAN and __LITTLE_ENDIAN are defined as are BIG_ENDIAN
iweiny> and LITTLE_ENDIAN.  I'm so confused?

#include <asm/byteorder.h>

then use __le32_to_cpu and friends (see
/usr/include/linux/byteorder/generic.h)

I'm not sure if that's the Proper Way(TM) to do it from user land
though.

Jesper

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list