aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/common.h')
-rw-r--r--src/utils/common.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/utils/common.h b/src/utils/common.h
index 79607d7..d649391 100644
--- a/src/utils/common.h
+++ b/src/utils/common.h
@@ -22,17 +22,24 @@
#include <byteswap.h>
#endif /* __linux__ */
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \
+ defined(__OpenBSD__)
#include <sys/types.h>
#include <sys/endian.h>
#define __BYTE_ORDER _BYTE_ORDER
#define __LITTLE_ENDIAN _LITTLE_ENDIAN
#define __BIG_ENDIAN _BIG_ENDIAN
+#ifdef __OpenBSD__
+#define bswap_16 swap16
+#define bswap_32 swap32
+#define bswap_64 swap64
+#else /* __OpenBSD__ */
#define bswap_16 bswap16
#define bswap_32 bswap32
#define bswap_64 bswap64
+#endif /* __OpenBSD__ */
#endif /* defined(__FreeBSD__) || defined(__NetBSD__) ||
- * defined(__DragonFly__) */
+ * defined(__DragonFly__) || defined(__OpenBSD__) */
#ifdef __APPLE__
#include <sys/types.h>