From 7dd6393f485ed3486156d9f03d357b473b638e48 Mon Sep 17 00:00:00 2001 From: thorpej Date: Mon, 17 Apr 2006 16:30:00 +0000 Subject: [PATCH] Check for . If it exists, use it to get the OSSwapBigToHostInt64() definition for HTOBE64(). This now builds on Mac OS X 10.4.6. --- dist/iscsi/include/compat.h | 8 +++++++- dist/iscsi/include/config.h | 3 +++ dist/iscsi/include/config.h.in | 3 +++ dist/iscsi/src/configure | 3 ++- dist/iscsi/src/configure.ac | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dist/iscsi/include/compat.h b/dist/iscsi/include/compat.h index 3b61b171f178..e681e136740f 100644 --- a/dist/iscsi/include/compat.h +++ b/dist/iscsi/include/compat.h @@ -30,6 +30,10 @@ #include #endif +#ifdef HAVE_LIBKERN_OSBYTEORDER_H +#include +#endif + #ifndef HAVE_STRLCPY size_t strlcpy(char *, const char *, size_t); #endif @@ -39,7 +43,9 @@ size_t strlcpy(char *, const char *, size_t); #endif #ifndef HTOBE64 -# if _BYTE_ORDER == _BIG_ENDIAN +# if defined(HAVE_LIBKERN_OSBYTEORDER_H) +# define HTOBE64(x) (x) = OSSwapBigToHostInt64((u_int64_t)(x)) +# elif _BYTE_ORDER == _BIG_ENDIAN # define HTOBE64(x) (x) # else /* LITTLE_ENDIAN */ # define HTOBE64(x) (x) = __bswap64((u_int64_t)(x)) diff --git a/dist/iscsi/include/config.h b/dist/iscsi/include/config.h index 0867b157c2e7..cfdfe5791ba5 100644 --- a/dist/iscsi/include/config.h +++ b/dist/iscsi/include/config.h @@ -37,6 +37,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBKERN_OSBYTEORDER_H */ + /* Define to 1 if you have the `nsl' library (-lnsl). */ /* #undef HAVE_LIBNSL */ diff --git a/dist/iscsi/include/config.h.in b/dist/iscsi/include/config.h.in index 4ff2e8aa6f0f..85f7ab777d60 100644 --- a/dist/iscsi/include/config.h.in +++ b/dist/iscsi/include/config.h.in @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBKERN_OSBYTEORDER_H + /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL diff --git a/dist/iscsi/src/configure b/dist/iscsi/src/configure index b21c26a4a046..317f8457b27f 100755 --- a/dist/iscsi/src/configure +++ b/dist/iscsi/src/configure @@ -3222,7 +3222,8 @@ done -for ac_header in asm/byteorder.h sys/byteorder.h byteswap.h machine/endian.h + +for ac_header in asm/byteorder.h sys/byteorder.h libkern/OSByteOrder.h byteswap.h machine/endian.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then diff --git a/dist/iscsi/src/configure.ac b/dist/iscsi/src/configure.ac index 095783e77695..18282dd64e01 100644 --- a/dist/iscsi/src/configure.ac +++ b/dist/iscsi/src/configure.ac @@ -13,7 +13,7 @@ dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(sys/types.h sys/param.h sys/stat.h sys/time.h sys/mman.h sys/uio.h sys/socket.h sys/time.h sys/vfs.h) AC_CHECK_HEADERS(arpa/inet.h netinet/in.h netinet/tcp.h netdb.h) -AC_CHECK_HEADERS(asm/byteorder.h sys/byteorder.h byteswap.h machine/endian.h) +AC_CHECK_HEADERS(asm/byteorder.h sys/byteorder.h libkern/OSByteOrder.h byteswap.h machine/endian.h) AC_CHECK_HEADERS(ctype.h errno.h fcntl.h pthread.h pwd.h signal.h stdlib.h syslog.h unistd.h string.h stdarg.h utime.h) dnl Checks for typedefs, structures, and compiler characteristics.