Skip to content

Commit

Permalink
Correct byteswap defines for BSDs
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmang9 committed Dec 31, 2020
1 parent 6657791 commit 582c1f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <machine/endian.h>
# else
# include <sys/endian.h>
# 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 <byteswap.h>
#endif
Expand Down

0 comments on commit 582c1f1

Please sign in to comment.