From 94d23b480e0343869582f13ae3ef27a74a60465b Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 10 Oct 2016 06:14:58 +0000 Subject: [PATCH] common: use system bswap* functions on more BSDs --- src/common/swap.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/swap.h b/src/common/swap.h index e241c9f73b..d94cbe6b25 100644 --- a/src/common/swap.h +++ b/src/common/swap.h @@ -21,7 +21,8 @@ #include #elif defined(__linux__) #include -#elif defined(__FreeBSD__) +#elif defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || \ + defined(__NetBSD__) || defined(__OpenBSD__) #include #endif #include @@ -101,7 +102,9 @@ inline __attribute__((always_inline)) u32 swap32(u32 _data) { inline __attribute__((always_inline)) u64 swap64(u64 _data) { return __builtin_bswap64(_data); } -#elif __FreeBSD__ +#elif defined(__Bitrig__) || defined(__OpenBSD__) +// swap16, swap32, swap64 are left as is +#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) inline u16 swap16(u16 _data) { return bswap16(_data); }