From 450304d3a14d24076900a42c83328f942e7bec51 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Mon, 25 Mar 2013 09:35:27 +0000 Subject: [PATCH] - #492: Fix endianness detection, revert to older lookup3.c detection and put new detect lines after previous tests, to avoid regressions but allow new detections to succeed. git-svn-id: file:///svn/unbound/trunk@2872 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 5 +++++ util/storage/lookup3.c | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index b4ff97c03..b1eda4d4d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,8 @@ +25 March 2013: Wouter + - #492: Fix endianness detection, revert to older lookup3.c detection + and put new detect lines after previous tests, to avoid regressions + but allow new detections to succeed. + 22 March 2013: Wouter - Fix resolve of names that use a mix of public and private addresses. - iana portlist update. diff --git a/util/storage/lookup3.c b/util/storage/lookup3.c index 845cc3886..700efb481 100644 --- a/util/storage/lookup3.c +++ b/util/storage/lookup3.c @@ -75,22 +75,24 @@ hash_set_raninit(uint32_t v) */ #if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ __BYTE_ORDER == __LITTLE_ENDIAN) || \ - (defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && \ - _BYTE_ORDER == _LITTLE_ENDIAN) || \ (defined(i386) || defined(__i386__) || defined(__i486__) || \ defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL)) # define HASH_LITTLE_ENDIAN 1 # define HASH_BIG_ENDIAN 0 -#elif (!defined(_BYTE_ORDER) && !defined(__BYTE_ORDER) && defined(_BIG_ENDIAN)) -# define HASH_LITTLE_ENDIAN 0 -# define HASH_BIG_ENDIAN 1 #elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \ __BYTE_ORDER == __BIG_ENDIAN) || \ - (defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && \ - _BYTE_ORDER == _BIG_ENDIAN) || \ (defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel)) # define HASH_LITTLE_ENDIAN 0 # define HASH_BIG_ENDIAN 1 +/* test later because it fails when they are defined to empty strings */ +#elif (defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && \ + _BYTE_ORDER == _BIG_ENDIAN) || \ +# define HASH_LITTLE_ENDIAN 0 +# define HASH_BIG_ENDIAN 1 +#elif (defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && \ + _BYTE_ORDER == _LITTLE_ENDIAN) || \ +# define HASH_LITTLE_ENDIAN 1 +# define HASH_BIG_ENDIAN 0 #else # define HASH_LITTLE_ENDIAN 0 # define HASH_BIG_ENDIAN 0 -- 2.47.2