| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#if __BYTE_ORDER == __LITTLE_ENDIAN |
| 17 |
# define __LONG_LONG_PAIR(HI, LO) LO, HI |
| 18 |
#elif __BYTE_ORDER == __BIG_ENDIAN |
| 19 |
# define __LONG_LONG_PAIR(HI, LO) HI, LO |
| 20 |
#endif |
| 21 |
|
| 22 |
#undef htobe16 |
| 23 |
#undef htole16 |
| 24 |
#undef htobe32 |
| 25 |
#undef htole32 |
| 26 |
#undef htobe64 |
| 27 |
#undef htole64 |
| 28 |
|
| 29 |
#undef be16toh |
| 30 |
#undef le16toh |
| 31 |
#undef be32toh |
| 32 |
#undef le32toh |
| 33 |
#undef be64toh |
| 34 |
#undef le64toh |
| 35 |
|
| 36 |
#if __BYTE_ORDER == __LITTLE_ENDIAN |
| 37 |
# define htobe16(x) __builtin_bswap16(x) |
| 38 |
# define htole16(x) (x) |
| 39 |
# define be16toh(x) __builtin_bswap16(x) |
| 40 |
# define le16toh(x) (x) |
| 41 |
|
| 42 |
# define htobe32(x) __builtin_bswap32(x) |
| 43 |
# define htole32(x) (x) |
| 44 |
# define be32toh(x) __builtin_bswap32(x) |
| 45 |
# define le32toh(x) (x) |
| 46 |
|
| 47 |
# define htobe64(x) __builtin_bswap64(x) |
| 48 |
# define htole64(x) (x) |
| 49 |
# define be64toh(x) __builtin_bswap64(x) |
| 50 |
# define le64toh(x) (x) |
| 51 |
#else |
| 52 |
# define htobe16(x) (x) |
| 53 |
# define htole16(x) __builtin_bswap16(x) |
| 54 |
# define be16toh(x) (x) |
| 55 |
# define le16toh(x) __builtin_bswap16(x) |
| 56 |
|
| 57 |
# define htobe32(x) (x) |
| 58 |
# define htole32(x) __builtin_bswap32(x) |
| 59 |
# define be32toh(x) (x) |
| 60 |
# define le32toh(x) __builtin_bswap32(x) |
| 61 |
|
| 62 |
# define htobe64(x) (x) |
| 63 |
# define htole64(x) __builtin_bswap64(x) |
| 64 |
# define be64toh(x) (x) |
| 65 |
# define le64toh(x) __builtin_bswap64(x) |
| 66 |
#endif |