summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/endianness.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-05-05 22:04:52 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-05-05 22:05:29 +0200
commitddab1927f6fa23495dc23af7860f2e0d01010978 (patch)
tree8fc5d268f55e09cf4a232a67205fa1762eea5cf0 /crawl-ref/source/endianness.h
parent3495f4ab936ad025bd2d9c4ab14c9a0119653322 (diff)
downloadcrawl-ref-ddab1927f6fa23495dc23af7860f2e0d01010978.tar.gz
crawl-ref-ddab1927f6fa23495dc23af7860f2e0d01010978.zip
Port to OpenSolaris (Dyson/Illumos).
This might be portability for portability sake (Solaris is so dead), but come on, we can't disappoint Igor Pashev by porting our stuff later than several hours after the first installable build of Dyson is released :)
Diffstat (limited to 'crawl-ref/source/endianness.h')
-rw-r--r--crawl-ref/source/endianness.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/endianness.h b/crawl-ref/source/endianness.h
index d9e96b1940..139f4b3cdc 100644
--- a/crawl-ref/source/endianness.h
+++ b/crawl-ref/source/endianness.h
@@ -1,6 +1,21 @@
#include <sys/types.h>
#include <sys/param.h>
+#ifdef __ANDROID__
+ #include <sys/endian.h>
+#endif
+
+#ifdef __sun
+# include <sys/isa_defs.h>
+# define LITTLE_ENDIAN 1234
+# define BIG_ENDIAN 4321
+# ifdef _LITTLE_ENDIAN
+# define BYTE_ORDER LITTLE_ENDIAN
+# else
+# define BYTE_ORDER BIG_ENDIAN
+# endif
+#endif
+
#ifndef htole32
#if BYTE_ORDER == LITTLE_ENDIAN
#define htole32(x) (x)