Blob


1 #include "../../config.h"
3 #if HAVE_SYS_ENDIAN
4 # include <sys/endian.h>
5 #elif HAVE_MACHINE_ENDIAN
6 # include <machine/endian.h>
7 # include <libkern/OSByteOrder.h>
9 # define htobe16(x) OSSwapHostToBigInt16(x)
10 # define htole16(x) OSSwapHostToLittleInt16(x)
11 # define be16toh(x) OSSwapBigToHostInt16(x)
12 # define le16toh(x) OSSwapLittleToHostInt16(x)
14 # define htobe32(x) OSSwapHostToBigInt32(x)
15 # define htole32(x) OSSwapHostToLittleInt32(x)
16 # define be32toh(x) OSSwapBigToHostInt32(x)
17 # define le32toh(x) OSSwapLittleToHostInt32(x)
19 # define htobe64(x) OSSwapHostToBigInt64(x)
20 # define htole64(x) OSSwapHostToLittleInt64(x)
21 # define be64toh(x) OSSwapBigToHostInt64(x)
22 # define le64toh(x) OSSwapLittleToHostInt64(x)
23 #else
24 # error no compatible endian.h header found
25 #endif