diff options
| author | Brent Cook <busterb@gmail.com> | 2021-11-09 07:17:04 -0600 |
|---|---|---|
| committer | Brent Cook <busterb@gmail.com> | 2021-11-09 07:17:04 -0600 |
| commit | c29f380d0c604efee33672172929c2e57554924f (patch) | |
| tree | 954ac1f8cc8fa55a56f4b3116d4919f9653b7da2 | |
| parent | b3b087416cdfb8061a42a0a8e46455b9156074d0 (diff) | |
| parent | fcf6c877881626ee2ac94fc77051c79e3f7ae7ce (diff) | |
| download | portable-c29f380d0c604efee33672172929c2e57554924f.tar.gz portable-c29f380d0c604efee33672172929c2e57554924f.tar.bz2 portable-c29f380d0c604efee33672172929c2e57554924f.zip | |
Land #689, support OSes with some non-POSIX headers
| -rw-r--r-- | include/compat/arpa/nameser.h | 2 | ||||
| -rw-r--r-- | include/compat/machine/endian.h | 2 | ||||
| -rw-r--r-- | include/compat/netinet/ip.h | 2 | ||||
| -rw-r--r-- | include/compat/resolv.h | 2 | ||||
| -rw-r--r-- | m4/check-libc.m4 | 6 |
5 files changed, 8 insertions, 6 deletions
diff --git a/include/compat/arpa/nameser.h b/include/compat/arpa/nameser.h index 0126a60..eff3b0d 100644 --- a/include/compat/arpa/nameser.h +++ b/include/compat/arpa/nameser.h | |||
| @@ -4,7 +4,9 @@ | |||
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | #ifndef _WIN32 | 6 | #ifndef _WIN32 |
| 7 | #ifdef HAVE_ARPA_NAMESER_H | ||
| 7 | #include_next <arpa/nameser.h> | 8 | #include_next <arpa/nameser.h> |
| 9 | #endif | ||
| 8 | #else | 10 | #else |
| 9 | #include <win32netcompat.h> | 11 | #include <win32netcompat.h> |
| 10 | 12 | ||
diff --git a/include/compat/machine/endian.h b/include/compat/machine/endian.h index 4dcb60d..bb22f5b 100644 --- a/include/compat/machine/endian.h +++ b/include/compat/machine/endian.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #define BYTE_ORDER BIG_ENDIAN | 21 | #define BYTE_ORDER BIG_ENDIAN |
| 22 | #endif | 22 | #endif |
| 23 | 23 | ||
| 24 | #elif defined(__linux__) || defined(__midipix__) | 24 | #elif defined(HAVE_ENDIAN_H) |
| 25 | #include <endian.h> | 25 | #include <endian.h> |
| 26 | 26 | ||
| 27 | #elif defined(__sun) || defined(_AIX) || defined(__hpux) | 27 | #elif defined(__sun) || defined(_AIX) || defined(__hpux) |
diff --git a/include/compat/netinet/ip.h b/include/compat/netinet/ip.h index 6019f7d..29f17f3 100644 --- a/include/compat/netinet/ip.h +++ b/include/compat/netinet/ip.h | |||
| @@ -8,7 +8,9 @@ | |||
| 8 | #endif | 8 | #endif |
| 9 | 9 | ||
| 10 | #ifndef _WIN32 | 10 | #ifndef _WIN32 |
| 11 | #ifdef HAVE_NETINET_IP_H | ||
| 11 | #include_next <netinet/ip.h> | 12 | #include_next <netinet/ip.h> |
| 13 | #endif | ||
| 12 | #else | 14 | #else |
| 13 | #include <win32netcompat.h> | 15 | #include <win32netcompat.h> |
| 14 | #endif | 16 | #endif |
diff --git a/include/compat/resolv.h b/include/compat/resolv.h index 42dec07..b804460 100644 --- a/include/compat/resolv.h +++ b/include/compat/resolv.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #else | 12 | #else |
| 13 | #include <../include/resolv.h> | 13 | #include <../include/resolv.h> |
| 14 | #endif | 14 | #endif |
| 15 | #else | 15 | #elif defined(HAVE_RESOLV_H) |
| 16 | #include_next <resolv.h> | 16 | #include_next <resolv.h> |
| 17 | #endif | 17 | #endif |
| 18 | 18 | ||
diff --git a/m4/check-libc.m4 b/m4/check-libc.m4 index e511f6d..cca97c3 100644 --- a/m4/check-libc.m4 +++ b/m4/check-libc.m4 | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | AC_DEFUN([CHECK_LIBC_COMPAT], [ | 1 | AC_DEFUN([CHECK_LIBC_COMPAT], [ |
| 2 | # Check for libc headers | 2 | # Check for libc headers |
| 3 | AC_CHECK_HEADERS([err.h readpassphrase.h]) | 3 | AC_CHECK_HEADERS([err.h readpassphrase.h]) |
| 4 | AC_CHECK_HEADERS([arpa/nameser.h endian.h netinet/ip.h resolv.h]) | ||
| 4 | # Check for general libc functions | 5 | # Check for general libc functions |
| 5 | AC_CHECK_FUNCS([asprintf freezero memmem]) | 6 | AC_CHECK_FUNCS([asprintf freezero memmem]) |
| 6 | AC_CHECK_FUNCS([readpassphrase reallocarray recallocarray]) | 7 | AC_CHECK_FUNCS([readpassphrase reallocarray recallocarray]) |
| @@ -9,10 +10,7 @@ AC_CHECK_FUNCS([timegm _mkgmtime timespecsub]) | |||
| 9 | AC_CHECK_FUNCS([getprogname syslog syslog_r]) | 10 | AC_CHECK_FUNCS([getprogname syslog syslog_r]) |
| 10 | AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [ | 11 | AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [ |
| 11 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | 12 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 12 | // Since Android NDK v16 getpagesize is defined as inline inside unistd.h | 13 | #include <unistd.h> |
| 13 | #ifdef __ANDROID__ | ||
| 14 | # include <unistd.h> | ||
| 15 | #endif | ||
| 16 | ]], [[ | 14 | ]], [[ |
| 17 | getpagesize(); | 15 | getpagesize(); |
| 18 | ]])], | 16 | ]])], |
