use betoh64 if be64toh not found
Instead of looking for htobe64 which is be available both when be64toh or betoh64 are, check for the latter functions. If we find betoh64 but not be64toh, use compat #defines. If both can't be found, search for OSX' OSSwapHostToBigInt64. Also include sys/types.h in byteorder.h (which is necessary for byteorder functions on OpenBSD), and incidentally fixes build of networkfragment.cc. Fixes build on OpenBSD Signed-off-by: Jérémie Courrèges-Anglas <jca@wxcvbn.org>
This commit is contained in:
@@ -35,13 +35,20 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_HTOBE64
|
||||
#if HAVE_DECL_BE64TOH || HAVE_DECL_BETOH64
|
||||
|
||||
# if defined(HAVE_ENDIAN_H)
|
||||
# include <endian.h>
|
||||
# elif defined(HAVE_SYS_ENDIAN_H)
|
||||
# include <sys/types.h>
|
||||
# include <sys/endian.h>
|
||||
# endif
|
||||
|
||||
#if !HAVE_DECL_BE64TOH && HAVE_DECL_BETOH64
|
||||
#define be64toh betoh64
|
||||
#define be16toh betoh16
|
||||
#endif
|
||||
|
||||
#elif HAVE_OSX_SWAP
|
||||
# include <libkern/OSByteOrder.h>
|
||||
# define htobe64 OSSwapHostToBigInt64
|
||||
|
||||
Reference in New Issue
Block a user