--- include/imp/util/Endian.orig 2018-08-24 09:23:34 UTC +++ include/imp/util/Endian @@ -12,6 +12,8 @@ # define BYTE_ORDER LITTLE_ENDIAN #elif defined(__APPLE__) # include +#elif defined(__FreeBSD__) +# include #else # include #endif @@ -57,6 +59,26 @@ namespace imp { inline uint64 swap_bytes(uint64 x) noexcept { return OSSwapInt64(x); } +} +#elif defined(__FreeBSD__) +namespace imp { + inline int16 swap_bytes(int16 x) noexcept + { return bswap16(x); } + + inline uint16 swap_bytes(uint16 x) noexcept + { return bswap16(x); } + + inline int32 swap_bytes(int32 x) noexcept + { return bswap32(x); } + + inline uint32 swap_bytes(uint32 x) noexcept + { return bswap32(x); } + + inline int64 swap_bytes(int64 x) noexcept + { return bswap64(x); } + + inline uint64 swap_bytes(uint64 x) noexcept + { return bswap64(x); } } #elif defined(__GNUC__) || defined(__clang__) namespace imp {