DragonFly has bswap* like FreeBSD, Bitrig - like OpenBSD

This commit is contained in:
Jan Beich 2015-05-25 13:52:48 +00:00
parent 7af88bf50e
commit b9b02eb403
2 changed files with 3 additions and 3 deletions

View File

@ -87,7 +87,7 @@ inline uint64 swap64(uint64 _data) {return ((uint64)swap32(_data) << 32) | swap3
inline uint16 swap16(uint16 _data) {return bswap_16(_data);}
inline uint32 swap32(uint32 _data) {return bswap_32(_data);}
inline uint64 swap64(uint64 _data) {return bswap_64(_data);}
#elif defined(__FreeBSD__)
#elif defined(__DragonFly__) || defined(__FreeBSD__)
#include <sys/endian.h>
inline uint16 swap16(uint16 _data) {return bswap16(_data);}
inline uint32 swap32(uint32 _data) {return bswap32(_data);}

View File

@ -68,12 +68,12 @@ static uint32 UNALIGNED_LOAD32(const char *p) {
#define bswap_32(x) BSWAP_32(x)
#define bswap_64(x) BSWAP_64(x)
#elif defined(__FreeBSD__)
#elif defined(__DragonFly__) || defined(__FreeBSD__)
#include <sys/endian.h>
#define bswap_32(x) bswap32(x)
#define bswap_64(x) bswap64(x)
#elif defined(__OpenBSD__)
#elif defined(__Bitrig__) || defined(__OpenBSD__)
#include <sys/types.h>
#define bswap_32(x) swap32(x)
#define bswap_64(x) swap64(x)