summaryrefslogtreecommitdiffstats
path: root/src/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal.h')
-rw-r--r--src/internal.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/internal.h b/src/internal.h
index 3a88d1a..2106401 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -9,4 +9,16 @@
# define EXPORT_SYMBOL
#endif
+#include <endian.h>
+#if !defined(htobe64)
+# include <byteswap.h>
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define htobe64(x) __bswap_64(x)
+# define betoh64(x) __bswap_64(x)
+# else
+# define htobe64(x) (x)
+# define betoh64(x) (x)
+# endif
+#endif
+
#endif