From 58c655abaeeb3d73cd228f66a3fa064c050c24bc Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 15 Jan 2017 09:51:44 +0000 Subject: [PATCH] Use autoconf to check for endian.h. --- configure.ac | 1 + src/include/compat/endian.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6af75aba..bc7b882c 100644 --- a/configure.ac +++ b/configure.ac @@ -85,6 +85,7 @@ dnl ================================================================ dnl library checks. dnl ================================================================ +AC_CHECK_HEADERS([endian.h]) dnl Linux AC_CHECK_HEADERS([fcntl.h]) dnl POSIX AC_CHECK_HEADERS([getopt.h]) dnl POSIX AC_CHECK_HEADERS([locale.h]) dnl C89 diff --git a/src/include/compat/endian.h b/src/include/compat/endian.h index afee523a..7bc8804a 100644 --- a/src/include/compat/endian.h +++ b/src/include/compat/endian.h @@ -19,7 +19,7 @@ #ifndef ENDIAN_H_COMPAT_SHIM #define ENDIAN_H_COMPAT_SHIM -#if defined(__linux__) || defined(__CYGWIN__) || defined(__EMSCRIPTEN__) +#if defined(HAVE_ENDIAN_H) # pragma GCC system_header // Silence "warning: #include_next is a GCC extension" # include_next #elif defined(__APPLE__)