From: Evan Nemerson Date: Tue, 15 Mar 2016 03:48:46 +0000 (-0700) Subject: Fix endianness-detection code on Solaris 11. X-Git-Tag: 1.9.9-b1~785 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8348a181e671865e22b1bdf77c1d51780cd0c0d9;p=thirdparty%2Fzlib-ng.git Fix endianness-detection code on Solaris 11. Solaris doesn't have sys/endian.h or endian.h, it has sys/byteorder.h, which doesn't define BYTE_ORDER, it defines either _LITTLE_ENDIAN or _BIG_ENDIAN. --- diff --git a/crc32.c b/crc32.c index c696aa35e..937f48d21 100644 --- a/crc32.c +++ b/crc32.c @@ -25,6 +25,21 @@ # include #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) # include +#elif defined(__sun) || defined(sun) +# include +# if !defined(LITTLE_ENDIAN) +# define LITTLE_ENDIAN 4321 +# endif +# if !defined(BIG_ENDIAN) +# define BIG_ENDIAN 1234 +# endif +# if !defined(BYTE_ORDER) +# if defined(_BIG_ENDIAN) +# define BYTE_ORDER BIG_ENDIAN +# else +# define BYTE_ORDER LITTLE_ENDIAN +# endif +# endif #else # include #endif