5 #ifndef FABCOIN_COMPAT_ENDIAN_H 6 #define FABCOIN_COMPAT_ENDIAN_H 8 #if defined(HAVE_CONFIG_H) 16 #if defined(HAVE_ENDIAN_H) 18 #elif defined(HAVE_SYS_ENDIAN_H) 19 #include <sys/endian.h> 22 #if defined(WORDS_BIGENDIAN) 24 #if HAVE_DECL_HTOBE16 == 0 25 inline uint16_t
htobe16(uint16_t host_16bits)
29 #endif // HAVE_DECL_HTOBE16 31 #if HAVE_DECL_HTOLE16 == 0 32 inline uint16_t
htole16(uint16_t host_16bits)
36 #endif // HAVE_DECL_HTOLE16 38 #if HAVE_DECL_BE16TOH == 0 39 inline uint16_t
be16toh(uint16_t big_endian_16bits)
41 return big_endian_16bits;
43 #endif // HAVE_DECL_BE16TOH 45 #if HAVE_DECL_LE16TOH == 0 46 inline uint16_t
le16toh(uint16_t little_endian_16bits)
48 return bswap_16(little_endian_16bits);
50 #endif // HAVE_DECL_LE16TOH 52 #if HAVE_DECL_HTOBE32 == 0 53 inline uint32_t
htobe32(uint32_t host_32bits)
57 #endif // HAVE_DECL_HTOBE32 59 #if HAVE_DECL_HTOLE32 == 0 60 inline uint32_t
htole32(uint32_t host_32bits)
64 #endif // HAVE_DECL_HTOLE32 66 #if HAVE_DECL_BE32TOH == 0 67 inline uint32_t
be32toh(uint32_t big_endian_32bits)
69 return big_endian_32bits;
71 #endif // HAVE_DECL_BE32TOH 73 #if HAVE_DECL_LE32TOH == 0 74 inline uint32_t
le32toh(uint32_t little_endian_32bits)
76 return bswap_32(little_endian_32bits);
78 #endif // HAVE_DECL_LE32TOH 80 #if HAVE_DECL_HTOBE64 == 0 81 inline uint64_t
htobe64(uint64_t host_64bits)
85 #endif // HAVE_DECL_HTOBE64 87 #if HAVE_DECL_HTOLE64 == 0 88 inline uint64_t
htole64(uint64_t host_64bits)
92 #endif // HAVE_DECL_HTOLE64 94 #if HAVE_DECL_BE64TOH == 0 95 inline uint64_t
be64toh(uint64_t big_endian_64bits)
97 return big_endian_64bits;
99 #endif // HAVE_DECL_BE64TOH 101 #if HAVE_DECL_LE64TOH == 0 102 inline uint64_t
le64toh(uint64_t little_endian_64bits)
104 return bswap_64(little_endian_64bits);
106 #endif // HAVE_DECL_LE64TOH 108 #else // WORDS_BIGENDIAN 110 #if HAVE_DECL_HTOBE16 == 0 115 #endif // HAVE_DECL_HTOBE16 117 #if HAVE_DECL_HTOLE16 == 0 122 #endif // HAVE_DECL_HTOLE16 124 #if HAVE_DECL_BE16TOH == 0 125 inline uint16_t
be16toh(uint16_t big_endian_16bits)
129 #endif // HAVE_DECL_BE16TOH 131 #if HAVE_DECL_LE16TOH == 0 132 inline uint16_t
le16toh(uint16_t little_endian_16bits)
134 return little_endian_16bits;
136 #endif // HAVE_DECL_LE16TOH 138 #if HAVE_DECL_HTOBE32 == 0 143 #endif // HAVE_DECL_HTOBE32 145 #if HAVE_DECL_HTOLE32 == 0 150 #endif // HAVE_DECL_HTOLE32 152 #if HAVE_DECL_BE32TOH == 0 153 inline uint32_t
be32toh(uint32_t big_endian_32bits)
157 #endif // HAVE_DECL_BE32TOH 159 #if HAVE_DECL_LE32TOH == 0 160 inline uint32_t
le32toh(uint32_t little_endian_32bits)
162 return little_endian_32bits;
164 #endif // HAVE_DECL_LE32TOH 166 #if HAVE_DECL_HTOBE64 == 0 171 #endif // HAVE_DECL_HTOBE64 173 #if HAVE_DECL_HTOLE64 == 0 178 #endif // HAVE_DECL_HTOLE64 180 #if HAVE_DECL_BE64TOH == 0 181 inline uint64_t
be64toh(uint64_t big_endian_64bits)
185 #endif // HAVE_DECL_BE64TOH 187 #if HAVE_DECL_LE64TOH == 0 188 inline uint64_t
le64toh(uint64_t little_endian_64bits)
190 return little_endian_64bits;
192 #endif // HAVE_DECL_LE64TOH 194 #endif // WORDS_BIGENDIAN 196 #endif // FABCOIN_COMPAT_ENDIAN_H uint32_t htobe32(uint32_t host_32bits)
uint64_t htole64(uint64_t host_64bits)
uint32_t bswap_32(uint32_t x)
uint32_t le32toh(uint32_t little_endian_32bits)
uint64_t le64toh(uint64_t little_endian_64bits)
uint16_t bswap_16(uint16_t x)
uint16_t htobe16(uint16_t host_16bits)
uint16_t le16toh(uint16_t little_endian_16bits)
uint64_t bswap_64(uint64_t x)
uint16_t be16toh(uint16_t big_endian_16bits)
uint16_t htole16(uint16_t host_16bits)
uint32_t htole32(uint32_t host_32bits)
uint64_t htobe64(uint64_t host_64bits)
uint64_t be64toh(uint64_t big_endian_64bits)
uint32_t be32toh(uint32_t big_endian_32bits)