4 * Like <endian.h>, but export only double-underscore symbols
7 #ifndef _KLIBC_ENDIAN_H
8 #define _KLIBC_ENDIAN_H
10 #define __LITTLE_ENDIAN /* we're on i386, littleendian */
12 /* Linux' asm/byteorder.h defines either __LITTLE_ENDIAN or
13 __BIG_ENDIAN, but the glibc/BSD-ish macros expect both to be
14 defined with __BYTE_ORDER defining which is actually used... */
16 #if defined(__LITTLE_ENDIAN)
17 # undef __LITTLE_ENDIAN
18 # define __LITTLE_ENDIAN 1234
19 # define __BIG_ENDIAN 4321
20 # define __PDP_ENDIAN 3412
21 # define __BYTE_ORDER __LITTLE_ENDIAN
22 #elif defined(__BIG_ENDIAN)
24 # define __LITTLE_ENDIAN 1234
25 # define __BIG_ENDIAN 4321
26 # define __PDP_ENDIAN 3412
27 # define __BYTE_ORDER __BIG_ENDIAN
28 #elif defined(__PDP_ENDIAN)
30 # define __LITTLE_ENDIAN 1234
31 # define __BIG_ENDIAN 4321
32 # define __PDP_ENDIAN 3412
33 # define __BYTE_ORDER __PDP_ENDIAN
35 # error "Unknown byte order!"
38 #endif /* _KLIBC_ENDIAN_H */