summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ebourne <martin@ebourne.me.uk>2005-12-28 07:35:17 +0000
committerMartin Ebourne <martin@ebourne.me.uk>2005-12-28 07:35:17 +0000
commit64b59e90e6adf33a99cd902964548ea82bab754d (patch)
treead97f8c46ff49aade05754062ce7a138e2dea5ce
parent2ad91211830d46536be022bd57c2aa942035f4de (diff)
Don't use betoh64/be64tonh to avoid name hassle
-rw-r--r--configure.ac2
-rw-r--r--lib/common/Box.h8
2 files changed, 4 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 3a1ced0a..42cce8c1 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([be64toh getpeereid kqueue lchown setproctitle])
+AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle])
AX_FUNC_SYSCALL
AX_CHECK_SYSCALL_LSEEK
diff --git a/lib/common/Box.h b/lib/common/Box.h
index 8ea08074..c988e296 100644
--- a/lib/common/Box.h
+++ b/lib/common/Box.h
@@ -137,12 +137,10 @@ inline uint64_t box_swap64(uint64_t x)
#else
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
+ // betoh64 (OpenBSD) is sometimes called be64toh (FreeBSD, NetBSD).
+ // Rather than check for it just reuse htobe64 since they are symmetrical
#define box_hton64(x) htobe64(x)
- #ifdef HAVE_BE64TOH
- #define box_ntoh64(x) be64toh(x)
- #else
- #define box_ntoh64(x) betoh64(x)
- #endif
+ #define box_ntoh64(x) htobe64(x)
#elif HAVE_ASM_BYTEORDER_H
#include <asm/byteorder.h>
#define box_hton64(x) __cpu_to_be64(x)