summaryrefslogtreecommitdiff
path: root/crc32.c
diff options
context:
space:
mode:
authorEvan Nemerson <evan@nemerson.com>2016-03-14 20:48:46 -0700
committerHans Kristian Rosbach <hk-git@circlestorm.org>2016-04-28 13:37:12 +0200
commit8348a181e671865e22b1bdf77c1d51780cd0c0d9 (patch)
tree636725349d199dec9bab0ab31492f7b68e5b6869 /crc32.c
parent1d227a260fcc2d7cce4198b979a5c80e3614b8d4 (diff)
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.
Diffstat (limited to 'crc32.c')
-rw-r--r--crc32.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/crc32.c b/crc32.c
index c696aa3..937f48d 100644
--- a/crc32.c
+++ b/crc32.c
@@ -25,6 +25,21 @@
# include <machine/endian.h>
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
# include <sys/endian.h>
+#elif defined(__sun) || defined(sun)
+# include <sys/byteorder.h>
+# 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 <endian.h>
#endif