xref: /illumos-gate/usr/src/lib/lib9p/common/illumos_endian.h (revision aa693e996c2928c92cccd8a3efe91373e85a6967)
1*aa693e99SJason King #ifndef __ILLUMOS_ENDIAN_H
2*aa693e99SJason King #define __ILLUMOS_ENDIAN_H
3*aa693e99SJason King 
4*aa693e99SJason King /*
5*aa693e99SJason King  * Shims to make illumos' endian headers and macros compatible
6*aa693e99SJason King  * with FreeBSD's <sys/endian.h>
7*aa693e99SJason King  */
8*aa693e99SJason King 
9*aa693e99SJason King # include <endian.h>
10*aa693e99SJason King 
11*aa693e99SJason King # define _COMPAT_LITTLE_ENDIAN 0x12345678
12*aa693e99SJason King # define _COMPAT_BIG_ENDIAN 0x87654321
13*aa693e99SJason King 
14*aa693e99SJason King # ifdef _LITTLE_ENDIAN
15*aa693e99SJason King #  define _BYTE_ORDER _COMPAT_LITTLE_ENDIAN
16*aa693e99SJason King # endif
17*aa693e99SJason King # ifdef _BIG_ENDIAN
18*aa693e99SJason King #  define _BYTE_ORDER _COMPAT_BIG_ENDIAN
19*aa693e99SJason King # endif
20*aa693e99SJason King 
21*aa693e99SJason King # undef _LITTLE_ENDIAN
22*aa693e99SJason King # undef _BIG_ENDIAN
23*aa693e99SJason King # define _LITTLE_ENDIAN _COMPAT_LITTLE_ENDIAN
24*aa693e99SJason King # define _BIG_ENDIAN _COMPAT_BIG_ENDIAN
25*aa693e99SJason King 
26*aa693e99SJason King #endif /* __ILLUMOS_ENDIAN_H */
27