X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fhash%2Fhash.c;h=4fe5cfe67c3f27c196964d5e00796ba80db49c67;hp=a9948821227899190dae5e79c63cb435e7d5d575;hb=5a5b9f8d3d187b15b9e7b427c7c3b2ac5ee7c6be;hpb=0a36c4014ffa3fc35d70f69303b6a9d3c697c693 diff --git a/ccan/hash/hash.c b/ccan/hash/hash.c index a9948821..4fe5cfe6 100644 --- a/ccan/hash/hash.c +++ b/ccan/hash/hash.c @@ -40,9 +40,7 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy. #include /* defines time_t for timings in the test */ #include /* defines uint32_t etc */ #include /* attempt to define endianness */ -#endif -#include "hash.h" #ifdef linux # include /* attempt to define endianness */ #endif @@ -66,6 +64,19 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy. #else # error Unknown endian #endif +#endif /* old hash.c headers. */ + +#include "hash.h" + +#if HAVE_LITTLE_ENDIAN +#define HASH_LITTLE_ENDIAN 1 +#define HASH_BIG_ENDIAN 0 +#elif HAVE_BIG_ENDIAN +#define HASH_LITTLE_ENDIAN 0 +#define HASH_BIG_ENDIAN 1 +#else +#error Unknown endian +#endif #define hashsize(n) ((uint32_t)1<<(n)) #define hashmask(n) (hashsize(n)-1)