Blame


1 e1828bab 2023-10-09 op #include "config.h"
2 4c1ef99c 2023-10-08 op
3 1a544105 2024-04-13 op #if HAVE_ENDIAN_H
4 1a544105 2024-04-13 op # include_next <endian.h>
5 1a544105 2024-04-13 op #elif HAVE_SYS_ENDIAN_H
6 4c1ef99c 2023-10-08 op # include <sys/endian.h>
7 4c1ef99c 2023-10-08 op #else
8 4c1ef99c 2023-10-08 op # include <machine/endian.h>
9 4c1ef99c 2023-10-08 op # include <libkern/OSByteOrder.h>
10 4c1ef99c 2023-10-08 op
11 4c1ef99c 2023-10-08 op # define htobe16(x) OSSwapHostToBigInt16(x)
12 4c1ef99c 2023-10-08 op # define htole16(x) OSSwapHostToLittleInt16(x)
13 4c1ef99c 2023-10-08 op # define be16toh(x) OSSwapBigToHostInt16(x)
14 4c1ef99c 2023-10-08 op # define le16toh(x) OSSwapLittleToHostInt16(x)
15 4c1ef99c 2023-10-08 op
16 4c1ef99c 2023-10-08 op # define htobe32(x) OSSwapHostToBigInt32(x)
17 4c1ef99c 2023-10-08 op # define htole32(x) OSSwapHostToLittleInt32(x)
18 4c1ef99c 2023-10-08 op # define be32toh(x) OSSwapBigToHostInt32(x)
19 4c1ef99c 2023-10-08 op # define le32toh(x) OSSwapLittleToHostInt32(x)
20 4c1ef99c 2023-10-08 op
21 4c1ef99c 2023-10-08 op # define htobe64(x) OSSwapHostToBigInt64(x)
22 4c1ef99c 2023-10-08 op # define htole64(x) OSSwapHostToLittleInt64(x)
23 4c1ef99c 2023-10-08 op # define be64toh(x) OSSwapBigToHostInt64(x)
24 4c1ef99c 2023-10-08 op # define le64toh(x) OSSwapLittleToHostInt64(x)
25 4c1ef99c 2023-10-08 op #endif