From: Wouter Wijngaards Date: Mon, 21 Jul 2014 00:06:54 +0000 (+0000) Subject: - Fix endian.h include for OpenBSD. X-Git-Tag: release-1.5.0rc1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec3b6d8bf754fdc20e599aa34c743026dfef1ec7;p=thirdparty%2Funbound.git - Fix endian.h include for OpenBSD. git-svn-id: file:///svn/unbound/trunk@3196 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/config.h.in b/config.h.in index ca2ca5a4f..08ba66596 100644 --- a/config.h.in +++ b/config.h.in @@ -89,6 +89,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the header file. */ +#undef HAVE_ENDIAN_H + /* Define to 1 if you have the `endprotoent' function. */ #undef HAVE_ENDPROTOENT diff --git a/configure b/configure index b6923f14d..34fa6e005 100755 --- a/configure +++ b/configure @@ -13692,7 +13692,7 @@ CC="$lt_save_CC" # Checks for header files. -for ac_header in stdarg.h stdbool.h netinet/in.h sys/param.h sys/socket.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h +for ac_header in stdarg.h stdbool.h netinet/in.h sys/param.h sys/socket.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default diff --git a/configure.ac b/configure.ac index 7bec4e1ba..d5df2992d 100644 --- a/configure.ac +++ b/configure.ac @@ -264,7 +264,7 @@ AC_CHECK_TOOL(STRIP, strip) ACX_LIBTOOL_C_ONLY # Checks for header files. -AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h sys/param.h sys/socket.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT]) +AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h sys/param.h sys/socket.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h],,, [AC_INCLUDES_DEFAULT]) # check for types. # Using own tests for int64* because autoconf builtin only give 32bit. diff --git a/doc/Changelog b/doc/Changelog index d19397cd8..1c364d441 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +21 July 2014: Wouter + - Fix endian.h include for OpenBSD. + 16 July 2014: Wouter - And Fix#596: Bail out of unbound-control dump_infra when ssl write fails. diff --git a/util/storage/lookup3.c b/util/storage/lookup3.c index 7596033bd..de288587b 100644 --- a/util/storage/lookup3.c +++ b/util/storage/lookup3.c @@ -53,15 +53,16 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy. #ifdef HAVE_SYS_TYPES_H # include /* attempt to define endianness (solaris) */ #endif -#ifdef linux -# include /* attempt to define endianness */ +#if defined(linux) || defined(__OpenBSD__) +# ifdef HAVE_ENDIAN_H +# include /* attempt to define endianness */ +# else +# include /* on older OpenBSD */ +# endif #endif #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) #include /* attempt to define endianness */ #endif -#ifdef __OpenBSD__ -#include /* attempt to define endianness */ -#endif /* random initial value */ static uint32_t raninit = (uint32_t)0xdeadbeef;