Adding upstream version 6.02~pre8+dfsg.
[syslinux-debian/hramrach.git] / com32 / include / klibc / endian.h
blob946642120ede3aebefc2ab740f66f0038dc828ac
1 /*
2 * klibc/endian.h
4 * Like <endian.h>, but export only double-underscore symbols
5 */
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)
23 # undef __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)
29 # undef __PDP_ENDIAN
30 # define __LITTLE_ENDIAN 1234
31 # define __BIG_ENDIAN 4321
32 # define __PDP_ENDIAN 3412
33 # define __BYTE_ORDER __PDP_ENDIAN
34 #else
35 # error "Unknown byte order!"
36 #endif
38 #endif /* _KLIBC_ENDIAN_H */