Blame


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