Land #689, support OSes with some non-POSIX headers

This commit is contained in:
Brent Cook 2021-11-09 07:17:04 -06:00
commit c29f380d0c
5 changed files with 8 additions and 6 deletions

View File

@ -4,7 +4,9 @@
*/ */
#ifndef _WIN32 #ifndef _WIN32
#ifdef HAVE_ARPA_NAMESER_H
#include_next <arpa/nameser.h> #include_next <arpa/nameser.h>
#endif
#else #else
#include <win32netcompat.h> #include <win32netcompat.h>

View File

@ -21,7 +21,7 @@
#define BYTE_ORDER BIG_ENDIAN #define BYTE_ORDER BIG_ENDIAN
#endif #endif
#elif defined(__linux__) || defined(__midipix__) #elif defined(HAVE_ENDIAN_H)
#include <endian.h> #include <endian.h>
#elif defined(__sun) || defined(_AIX) || defined(__hpux) #elif defined(__sun) || defined(_AIX) || defined(__hpux)

View File

@ -8,7 +8,9 @@
#endif #endif
#ifndef _WIN32 #ifndef _WIN32
#ifdef HAVE_NETINET_IP_H
#include_next <netinet/ip.h> #include_next <netinet/ip.h>
#endif
#else #else
#include <win32netcompat.h> #include <win32netcompat.h>
#endif #endif

View File

@ -12,7 +12,7 @@
#else #else
#include <../include/resolv.h> #include <../include/resolv.h>
#endif #endif
#else #elif defined(HAVE_RESOLV_H)
#include_next <resolv.h> #include_next <resolv.h>
#endif #endif

View File

@ -1,6 +1,7 @@
AC_DEFUN([CHECK_LIBC_COMPAT], [ AC_DEFUN([CHECK_LIBC_COMPAT], [
# Check for libc headers # Check for libc headers
AC_CHECK_HEADERS([err.h readpassphrase.h]) AC_CHECK_HEADERS([err.h readpassphrase.h])
AC_CHECK_HEADERS([arpa/nameser.h endian.h netinet/ip.h resolv.h])
# Check for general libc functions # Check for general libc functions
AC_CHECK_FUNCS([asprintf freezero memmem]) AC_CHECK_FUNCS([asprintf freezero memmem])
AC_CHECK_FUNCS([readpassphrase reallocarray recallocarray]) AC_CHECK_FUNCS([readpassphrase reallocarray recallocarray])
@ -9,10 +10,7 @@ AC_CHECK_FUNCS([timegm _mkgmtime timespecsub])
AC_CHECK_FUNCS([getprogname syslog syslog_r]) AC_CHECK_FUNCS([getprogname syslog syslog_r])
AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [ AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
// Since Android NDK v16 getpagesize is defined as inline inside unistd.h #include <unistd.h>
#ifdef __ANDROID__
# include <unistd.h>
#endif
]], [[ ]], [[
getpagesize(); getpagesize();
]])], ]])],