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