Check for <libkern/OSByteOrder.h>. If it exists, use it to get the

OSSwapBigToHostInt64() definition for HTOBE64().  This now builds on
Mac OS X 10.4.6.
This commit is contained in:
thorpej 2006-04-17 16:30:00 +00:00
parent 862fe20f05
commit 7dd6393f48
5 changed files with 16 additions and 3 deletions

View File

@ -30,6 +30,10 @@
#include <machine/endian.h>
#endif
#ifdef HAVE_LIBKERN_OSBYTEORDER_H
#include <libkern/OSByteOrder.h>
#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))

View File

@ -37,6 +37,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <libkern/OSByteOrder.h> header file. */
/* #undef HAVE_LIBKERN_OSBYTEORDER_H */
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef HAVE_LIBNSL */

View File

@ -36,6 +36,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <libkern/OSByteOrder.h> header file. */
#undef HAVE_LIBKERN_OSBYTEORDER_H
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL

View File

@ -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

View File

@ -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.