summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--lib/common/Box.h6
2 files changed, 6 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 42cce8c1..3a1ced0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,7 +112,7 @@ AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_TYPE_SIGNAL
AC_FUNC_STAT
-AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle])
+AC_CHECK_FUNCS([be64toh getpeereid kqueue lchown setproctitle])
AX_FUNC_SYSCALL
AX_CHECK_SYSCALL_LSEEK
diff --git a/lib/common/Box.h b/lib/common/Box.h
index 326bed38..8ea08074 100644
--- a/lib/common/Box.h
+++ b/lib/common/Box.h
@@ -138,7 +138,11 @@ inline uint64_t box_swap64(uint64_t x)
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#define box_hton64(x) htobe64(x)
- #define box_ntoh64(x) betoh64(x)
+ #ifdef HAVE_BE64TOH
+ #define box_ntoh64(x) be64toh(x)
+ #else
+ #define box_ntoh64(x) betoh64(x)
+ #endif
#elif HAVE_ASM_BYTEORDER_H
#include <asm/byteorder.h>
#define box_hton64(x) __cpu_to_be64(x)