Skip to content

Commit 3a2ca9b

Browse files
committed
Merge pull request #6246
0640a5e Add an alternate location of endian.h header (Andriy Voskoboinyk)
2 parents c57e12a + 0640a5e commit 3a2ca9b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

configure.ac

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ if test x$TARGET_OS = xdarwin; then
438438
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
439439
fi
440440

441-
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])
441+
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])
442442
AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])])
443443
AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])])
444444

@@ -447,6 +447,8 @@ AC_CHECK_DECLS([strnlen])
447447
AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
448448
[#if HAVE_ENDIAN_H
449449
#include <endian.h>
450+
#elif HAVE_SYS_ENDIAN_H
451+
#include <sys/endian.h>
450452
#endif])
451453

452454
AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,,

src/compat/endian.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#if defined(HAVE_ENDIAN_H)
1717
#include <endian.h>
18+
#elif defined(HAVE_SYS_ENDIAN_H)
19+
#include <sys/endian.h>
1820
#endif
1921

2022
#if defined(WORDS_BIGENDIAN)

0 commit comments

Comments
 (0)