summaryrefslogtreecommitdiff
path: root/bswap.h
diff options
context:
space:
mode:
Diffstat (limited to 'bswap.h')
-rw-r--r--bswap.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/bswap.h b/bswap.h
index 523d805a21..08b77d9377 100644
--- a/bswap.h
+++ b/bswap.h
@@ -5,6 +5,12 @@
#include <inttypes.h>
+#ifdef HAVE_MACHINE_BSWAP_H
+#include <sys/endian.h>
+#include <sys/types.h>
+#include <machine/bswap.h>
+#else
+
#ifdef HAVE_BYTESWAP_H
#include <byteswap.h>
#else
@@ -58,6 +64,8 @@ static inline uint64_t bswap64(uint64_t x)
return bswap_64(x);
}
+#endif /* ! HAVE_MACHINE_BSWAP_H */
+
static inline void bswap16s(uint16_t *s)
{
*s = bswap16(*s);