diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-05-21 20:36:13 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-05-21 20:36:13 +0000 |
| commit | 23386ed8f28faa3208966e45f21c0e83830eaece (patch) | |
| tree | ce127bfb60002564f992e8e5afd9673594914fbf /llvm | |
| parent | 1cec8abfe953167e85d10eea38caf3a4e5affd60 (diff) | |
| download | bcm5719-llvm-23386ed8f28faa3208966e45f21c0e83830eaece.tar.gz bcm5719-llvm-23386ed8f28faa3208966e45f21c0e83830eaece.zip | |
Define BYTE_ORDER on Solaris.
Solaris doesn't have an endian.h header, but SPARC is the only
big-endian architecture that runs Solaris, so just use that to detect
endianness at compile time.
llvm-svn: 182419
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Support/Host.h | 2 | ||||
| -rw-r--r-- | llvm/include/llvm/Support/Solaris.h | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/Host.h b/llvm/include/llvm/Support/Host.h index 9a4036a8aff..7246f51457d 100644 --- a/llvm/include/llvm/Support/Host.h +++ b/llvm/include/llvm/Support/Host.h @@ -19,7 +19,7 @@ #if defined(__linux__) #include <endian.h> #else -#ifndef LLVM_ON_WIN32 +#if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32) #include <machine/endian.h> #endif #endif diff --git a/llvm/include/llvm/Support/Solaris.h b/llvm/include/llvm/Support/Solaris.h index 6228c4b43b5..b0822853248 100644 --- a/llvm/include/llvm/Support/Solaris.h +++ b/llvm/include/llvm/Support/Solaris.h @@ -17,6 +17,15 @@ #include <sys/types.h> #include <sys/regset.h> +/* Solaris doesn't have endian.h. SPARC is the only supported big-endian ISA. */ +#define BIG_ENDIAN 4321 +#define LITTLE_ENDIAN 1234 +#if defined(__sparc) || defined(__sparc__) +#define BYTE_ORDER BIG_ENDIAN +#else +#define BYTE_ORDER LITTLE_ENDIAN +#endif + #undef CS #undef DS #undef ES |

