/* spdx-license-identifier: ISC */ #include "endian.h" #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ #error little.c included in build on big endian target #endif uint16_t htole16(uint16_t host_16b) { return host_16b; } uint32_t htole32(uint32_t host_32b) { return host_32b; } uint64_t htole64(uint64_t host_64b) { return host_64b; } uint16_t htobe16(uint16_t host_16b) { return __builtin_bswap16(host_16b); } uint32_t htobe32(uint32_t host_32b) { return __builtin_bswap32(host_32b); } uint64_t htobe64(uint64_t host_64b) { return __builtin_bswap64(host_64b); }