diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-06-16 21:18:20 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-06-16 21:18:20 +0000 |
commit | 5c91898e57336d8457bddce63e4d7ba7fedc936e (patch) | |
tree | 77e16c5137a96a3e6c9f5c7354b0ed0eed790a76 | |
parent | 6d3b7fa80ed0a3598866cddaf7149bcfbb5a6086 (diff) | |
download | external_llvm-5c91898e57336d8457bddce63e4d7ba7fedc936e.zip external_llvm-5c91898e57336d8457bddce63e4d7ba7fedc936e.tar.gz external_llvm-5c91898e57336d8457bddce63e4d7ba7fedc936e.tar.bz2 |
Whoops. I didn't mean to step on John's changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6722 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/Support/DataTypes.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/include/Support/DataTypes.h b/include/Support/DataTypes.h index 9ce2210a..8a8952f 100644 --- a/include/Support/DataTypes.h +++ b/include/Support/DataTypes.h @@ -4,10 +4,10 @@ // This file is important because different host OS's define different macros, // which makes portability tough. This file exports the following definitions: // -// LITTLE_ENDIAN: is #define'd if the host is little endian -// int64_t : is a typedef for the signed 64 bit system type -// uint64_t : is a typedef for the unsigned 64 bit system type -// INT64_MAX : is a #define specifying the max value for int64_t's +// ENDIAN_LITTLE : is #define'd if the host is little endian +// int64_t : is a typedef for the signed 64 bit system type +// uint64_t : is a typedef for the unsigned 64 bit system type +// INT64_MAX : is a #define specifying the max value for int64_t's // // No library is required when using these functinons. // @@ -59,11 +59,26 @@ # endif #endif -#if (defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)) -#error "Cannot define both LITTLE_ENDIAN and BIG_ENDIAN!" +// +// Convert the information from the header files into our own local +// endian macros. We do this because various strange systems define both +// BIG_ENDIAN and LITTLE_ENDIAN, and we don't want to conflict with them. +// +// Don't worry; once we introduce autoconf, this will look a lot nicer. +// +#ifdef LITTLE_ENDIAN +#define ENDIAN_LITTLE +#endif + +#ifdef BIG_ENDIAN +#define ENDIAN_BIG +#endif + +#if (defined(ENDIAN_LITTLE) && defined(ENDIAN_BIG)) +#error "Cannot define both ENDIAN_LITTLE and ENDIAN_BIG!" #endif -#if (!defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)) || !defined(INT64_MAX) +#if (!defined(ENDIAN_LITTLE) && !defined(ENDIAN_BIG)) || !defined(INT64_MAX) #error "include/Support/DataTypes.h could not determine endianness!" #endif |