diff options
author | Andriy Voskoboinyk <andriivos@gmail.com> | 2015-06-07 04:38:31 +0300 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-06-23 09:03:09 +0200 |
commit | 8ea6d37aeed67d42428e38dcf3ee0771c8fff1d1 (patch) | |
tree | 76ff6f36a2695d001d807b2b580ce8b6b0332cdc | |
parent | b7115995d711ae64fc4a4e5954db7f6130ffee2f (diff) | |
download | bitcoin-8ea6d37aeed67d42428e38dcf3ee0771c8fff1d1.tar.xz |
Add an alternate location of endian.h header
Github-Pull: #6246
Rebased-From: 0640a5eb60b06de61f873fd88ae0252f5a11c339
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/compat/endian.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 7b84827c7c..37fe47e3c9 100644 --- a/configure.ac +++ b/configure.ac @@ -438,7 +438,7 @@ if test x$TARGET_OS = xdarwin; then AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"]) fi -AC_CHECK_HEADERS([endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h]) +AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h]) AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])]) AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])]) @@ -447,6 +447,8 @@ AC_CHECK_DECLS([strnlen]) AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,, [#if HAVE_ENDIAN_H #include <endian.h> + #elif HAVE_SYS_ENDIAN_H + #include <sys/endian.h> #endif]) AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,, diff --git a/src/compat/endian.h b/src/compat/endian.h index 4d041d6554..9fec2a07fa 100644 --- a/src/compat/endian.h +++ b/src/compat/endian.h @@ -15,6 +15,8 @@ #if defined(HAVE_ENDIAN_H) #include <endian.h> +#elif defined(HAVE_SYS_ENDIAN_H) +#include <sys/endian.h> #endif #if defined(WORDS_BIGENDIAN) |