summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2016-10-10 08:14:58 +0200
committerJan Beich <jbeich@FreeBSD.org>2016-10-28 01:28:30 +0200
commit94d23b480e0343869582f13ae3ef27a74a60465b (patch)
tree9b54d8d3b1040e816303cf78098f6d50a7595224 /src/common
parentcommon: use system CPUID routine on DragonFly as well (diff)
downloadyuzu-94d23b480e0343869582f13ae3ef27a74a60465b.tar
yuzu-94d23b480e0343869582f13ae3ef27a74a60465b.tar.gz
yuzu-94d23b480e0343869582f13ae3ef27a74a60465b.tar.bz2
yuzu-94d23b480e0343869582f13ae3ef27a74a60465b.tar.lz
yuzu-94d23b480e0343869582f13ae3ef27a74a60465b.tar.xz
yuzu-94d23b480e0343869582f13ae3ef27a74a60465b.tar.zst
yuzu-94d23b480e0343869582f13ae3ef27a74a60465b.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/swap.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/swap.h b/src/common/swap.h
index e241c9f73..d94cbe6b2 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -21,7 +21,8 @@
#include <cstdlib>
#elif defined(__linux__)
#include <byteswap.h>
-#elif defined(__FreeBSD__)
+#elif defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || \
+ defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/endian.h>
#endif
#include <cstring>
@@ -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);
}