X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/ba798261ce70a866d347978e942e35292da1f6a2..a2f4f8711a7ded05d950fe0b784a5e4c7abeb298:/sha1.c diff --git a/sha1.c b/sha1.c index a768a7a7..2c50433e 100644 --- a/sha1.c +++ b/sha1.c @@ -24,13 +24,16 @@ A million repetitions of "a" #include #include #include /* for u_int*_t */ +#if defined(__sun) +#include "solarisfixes.h" +#endif #include "sha1.h" #ifndef BYTE_ORDER #if (BSD >= 199103) # include #else -#ifdef linux +#if defined(linux) || defined(__linux__) # include #else #define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */ @@ -49,13 +52,21 @@ A million repetitions of "a" defined(apollo) || defined(__convex__) || defined(_CRAY) || \ defined(__hppa) || defined(__hp9000) || \ defined(__hp9000s300) || defined(__hp9000s700) || \ - defined (BIT_ZERO_ON_LEFT) || defined(m68k) + defined (BIT_ZERO_ON_LEFT) || defined(m68k) || defined(__sparc) #define BYTE_ORDER BIG_ENDIAN #endif #endif /* linux */ #endif /* BSD */ #endif /* BYTE_ORDER */ +#if defined(__BYTE_ORDER) && !defined(BYTE_ORDER) +#if (__BYTE_ORDER == __LITTLE_ENDIAN) +#define BYTE_ORDER LITTLE_ENDIAN +#else +#define BYTE_ORDER BIG_ENDIAN +#endif +#endif + #if !defined(BYTE_ORDER) || \ (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \ BYTE_ORDER != PDP_ENDIAN) @@ -64,7 +75,7 @@ A million repetitions of "a" * which will force your compiles to bomb until you fix * the above macros. */ - error "Undefined or invalid BYTE_ORDER"; +#error "Undefined or invalid BYTE_ORDER" #endif #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))