diff --git a/src/util.hpp b/src/util.hpp index 9ffe4aaf2..2933fa2cb 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -68,15 +68,15 @@ std::ostream &operator<<(std::ostream &strm, uint128_t const &v) #define bswap_16(x) OSSwapInt16(x) #define bswap_32(x) OSSwapInt32(x) #define bswap_64(x) OSSwapInt64(x) -#elif defined(BSD) || defined(_SYSTYPE_BSD) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) # if defined(__OpenBSD__) # include # else # include # endif -#define bswap_16(x) bswap_16(x) -#define bswap_32(x) bswap_16(x) -#define bswap_64(x) bswap_16(x) +#define bswap_16(x) bswap16(x) +#define bswap_32(x) bswap32(x) +#define bswap_64(x) bswap64(x) #else #include #endif