diff options
| author | 2016-10-10 06:14:58 +0000 | |
|---|---|---|
| committer | 2016-10-27 23:28:30 +0000 | |
| commit | 94d23b480e0343869582f13ae3ef27a74a60465b (patch) | |
| tree | 9b54d8d3b1040e816303cf78098f6d50a7595224 /src | |
| parent | common: use system CPUID routine on DragonFly as well (diff) | |
| download | yuzu-94d23b480e0343869582f13ae3ef27a74a60465b.tar.gz yuzu-94d23b480e0343869582f13ae3ef27a74a60465b.tar.xz yuzu-94d23b480e0343869582f13ae3ef27a74a60465b.zip | |
common: use system bswap* functions on more BSDs
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/swap.h | 7 |
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 @@ | |||
| 21 | #include <cstdlib> | 21 | #include <cstdlib> |
| 22 | #elif defined(__linux__) | 22 | #elif defined(__linux__) |
| 23 | #include <byteswap.h> | 23 | #include <byteswap.h> |
| 24 | #elif defined(__FreeBSD__) | 24 | #elif defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || \ |
| 25 | defined(__NetBSD__) || defined(__OpenBSD__) | ||
| 25 | #include <sys/endian.h> | 26 | #include <sys/endian.h> |
| 26 | #endif | 27 | #endif |
| 27 | #include <cstring> | 28 | #include <cstring> |
| @@ -101,7 +102,9 @@ inline __attribute__((always_inline)) u32 swap32(u32 _data) { | |||
| 101 | inline __attribute__((always_inline)) u64 swap64(u64 _data) { | 102 | inline __attribute__((always_inline)) u64 swap64(u64 _data) { |
| 102 | return __builtin_bswap64(_data); | 103 | return __builtin_bswap64(_data); |
| 103 | } | 104 | } |
| 104 | #elif __FreeBSD__ | 105 | #elif defined(__Bitrig__) || defined(__OpenBSD__) |
| 106 | // swap16, swap32, swap64 are left as is | ||
| 107 | #elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) | ||
| 105 | inline u16 swap16(u16 _data) { | 108 | inline u16 swap16(u16 _data) { |
| 106 | return bswap16(_data); | 109 | return bswap16(_data); |
| 107 | } | 110 | } |