Lines 67-82
typedef __uint64_t uint64_t;
Link Here
|
67 |
* endian to host byte order functions as detailed in byteorder(9). |
67 |
* endian to host byte order functions as detailed in byteorder(9). |
68 |
*/ |
68 |
*/ |
69 |
#if _BYTE_ORDER == _LITTLE_ENDIAN |
69 |
#if _BYTE_ORDER == _LITTLE_ENDIAN |
70 |
#define htobe16(x) bswap16((x)) |
70 |
#define htobe16(x) __bswap16((x)) |
71 |
#define htobe32(x) bswap32((x)) |
71 |
#define htobe32(x) __bswap32((x)) |
72 |
#define htobe64(x) bswap64((x)) |
72 |
#define htobe64(x) __bswap64((x)) |
73 |
#define htole16(x) ((uint16_t)(x)) |
73 |
#define htole16(x) ((uint16_t)(x)) |
74 |
#define htole32(x) ((uint32_t)(x)) |
74 |
#define htole32(x) ((uint32_t)(x)) |
75 |
#define htole64(x) ((uint64_t)(x)) |
75 |
#define htole64(x) ((uint64_t)(x)) |
76 |
|
76 |
|
77 |
#define be16toh(x) bswap16((x)) |
77 |
#define be16toh(x) __bswap16((x)) |
78 |
#define be32toh(x) bswap32((x)) |
78 |
#define be32toh(x) __bswap32((x)) |
79 |
#define be64toh(x) bswap64((x)) |
79 |
#define be64toh(x) __bswap64((x)) |
80 |
#define le16toh(x) ((uint16_t)(x)) |
80 |
#define le16toh(x) ((uint16_t)(x)) |
81 |
#define le32toh(x) ((uint32_t)(x)) |
81 |
#define le32toh(x) ((uint32_t)(x)) |
82 |
#define le64toh(x) ((uint64_t)(x)) |
82 |
#define le64toh(x) ((uint64_t)(x)) |
Lines 84-99
typedef __uint64_t uint64_t;
Link Here
|
84 |
#define htobe16(x) ((uint16_t)(x)) |
84 |
#define htobe16(x) ((uint16_t)(x)) |
85 |
#define htobe32(x) ((uint32_t)(x)) |
85 |
#define htobe32(x) ((uint32_t)(x)) |
86 |
#define htobe64(x) ((uint64_t)(x)) |
86 |
#define htobe64(x) ((uint64_t)(x)) |
87 |
#define htole16(x) bswap16((x)) |
87 |
#define htole16(x) __bswap16((x)) |
88 |
#define htole32(x) bswap32((x)) |
88 |
#define htole32(x) __bswap32((x)) |
89 |
#define htole64(x) bswap64((x)) |
89 |
#define htole64(x) __bswap64((x)) |
90 |
|
90 |
|
91 |
#define be16toh(x) ((uint16_t)(x)) |
91 |
#define be16toh(x) ((uint16_t)(x)) |
92 |
#define be32toh(x) ((uint32_t)(x)) |
92 |
#define be32toh(x) ((uint32_t)(x)) |
93 |
#define be64toh(x) ((uint64_t)(x)) |
93 |
#define be64toh(x) ((uint64_t)(x)) |
94 |
#define le16toh(x) bswap16((x)) |
94 |
#define le16toh(x) __bswap16((x)) |
95 |
#define le32toh(x) bswap32((x)) |
95 |
#define le32toh(x) __bswap32((x)) |
96 |
#define le64toh(x) bswap64((x)) |
96 |
#define le64toh(x) __bswap64((x)) |
97 |
#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ |
97 |
#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ |
98 |
|
98 |
|
99 |
/* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ |
99 |
/* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ |