]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
more fixes for endianness.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 26 Mar 2013 08:14:06 +0000 (08:14 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 26 Mar 2013 08:14:06 +0000 (08:14 +0000)
git-svn-id: file:///svn/unbound/trunk@2877 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/storage/lookup3.c

index 29e2df976cd72ddb6bb6063863f91feed7a6b145..917b325220010f6ba26b02465e19c1e5715ca439 100644 (file)
@@ -1,3 +1,6 @@
+26 March 2013: Wouter
+       - more fixes to lookup3.c endianness detection.
+
 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
index 314530f56679c38e009a00f9406595b17639ea2a..3f8c8f3579fc8dce8c3b3f35961c1d959fb044a0 100644 (file)
@@ -50,6 +50,9 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy.
 #include <time.h>       /* defines time_t for timings in the test */
 /*#include <stdint.h>     defines uint32_t etc  (from config.h) */
 #include <sys/param.h>  /* attempt to define endianness */
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h> /* attempt to define endianness (solaris) */
+#endif
 #ifdef linux
 # include <endian.h>    /* attempt to define endianness */
 #endif
@@ -84,15 +87,16 @@ hash_set_raninit(uint32_t v)
       (defined(sparc) || defined(__sparc) || defined(__sparc__) || defined(POWERPC) || defined(mc68000) || defined(sel))
 # define HASH_LITTLE_ENDIAN 0
 # define HASH_BIG_ENDIAN 1
+#elif defined(_MACHINE_ENDIAN_H_)
 /* test for machine_endian_h protects failure if some are empty strings */
-#elif (defined(_MACHINE_ENDIAN_H_) && defined(_BYTE_ORDER) && \
-       defined(_BIG_ENDIAN) && _BYTE_ORDER == _BIG_ENDIAN)
-# define HASH_LITTLE_ENDIAN 0
-# define HASH_BIG_ENDIAN 1
-#elif (defined(_MACHINE_ENDIAN_H_) && defined(_BYTE_ORDER) && \
-       defined(_LITTLE_ENDIAN) && _BYTE_ORDER == _LITTLE_ENDIAN)
-# define HASH_LITTLE_ENDIAN 1
-# define HASH_BIG_ENDIAN 0
+# if defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && _BYTE_ORDER == _BIG_ENDIAN
+#  define HASH_LITTLE_ENDIAN 0
+#  define HASH_BIG_ENDIAN 1
+# endif
+# if defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && _BYTE_ORDER == _LITTLE_ENDIAN
+#  define HASH_LITTLE_ENDIAN 1
+#  define HASH_BIG_ENDIAN 0
+# endif /* _MACHINE_ENDIAN_H_ */
 #else
 # define HASH_LITTLE_ENDIAN 0
 # define HASH_BIG_ENDIAN 0