summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Host.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/Host.h')
-rw-r--r--include/llvm/Support/Host.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h
index 89986fdae9713..be93dd99032e2 100644
--- a/include/llvm/Support/Host.h
+++ b/include/llvm/Support/Host.h
@@ -21,6 +21,16 @@
#include <endian.h>
#elif defined(_AIX)
#include <sys/machine.h>
+#elif defined(__sun)
+/* Solaris provides _BIG_ENDIAN/_LITTLE_ENDIAN selector in sys/types.h */
+#include <sys/types.h>
+#define BIG_ENDIAN 4321
+#define LITTLE_ENDIAN 1234
+#if defined(_BIG_ENDIAN)
+#define BYTE_ORDER BIG_ENDIAN
+#else
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
#else
#if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32)
#include <machine/endian.h>