Detect machine/endian.h for macOS

This commit is contained in:
Jiajie Chen 2022-07-12 22:29:39 +08:00
parent 5f5feb2bbc
commit ef2d6c70da
3 changed files with 9 additions and 1 deletions

View File

@ -291,6 +291,11 @@ if(HAVE_ENDIAN_H)
add_definitions(-DHAVE_ENDIAN_H)
endif()
check_include_files(machine/endian.h HAVE_MACHINE_ENDIAN_H)
if(HAVE_MACHINE_ENDIAN_H)
add_definitions(-DHAVE_MACHINE_ENDIAN_H)
endif()
check_include_files(err.h HAVE_ERR_H)
if(HAVE_ERR_H)
add_definitions(-DHAVE_ERR_H)

View File

@ -24,6 +24,9 @@
#elif defined(HAVE_ENDIAN_H)
#include_next <endian.h>
#elif defined(HAVE_MACHINE_ENDIAN_H)
#include_next <machine/endian.h>
#elif defined(__sun) || defined(_AIX) || defined(__hpux)
#include <sys/types.h>
#include <arpa/nameser_compat.h>

View File

@ -1,6 +1,6 @@
AC_DEFUN([CHECK_LIBC_COMPAT], [
# Check for libc headers
AC_CHECK_HEADERS([endian.h err.h readpassphrase.h])
AC_CHECK_HEADERS([endian.h machine/endian.h err.h readpassphrase.h])
AC_CHECK_HEADERS([netinet/ip.h], [], [],
[#include <sys/types.h>
#include <arpa/inet.h>