diff options
author | Dylan Noblesmith <nobled@dreamwidth.org> | 2012-07-27 18:34:31 +0000 |
---|---|---|
committer | Dylan Noblesmith <nobled@dreamwidth.org> | 2012-07-27 18:34:31 +0000 |
commit | 3b198a97d2aceb1620483586c8c3cabf9e5e8078 (patch) | |
tree | f4792ddc284598ffe6b6fa90f0f8a5067fa5ca8f /lib/Basic/ConvertUTF.c | |
parent | 9369d4f9303ba3ea7b5cb413e7755a40848d2edd (diff) |
Preprocessor: add __BYTE_ORDER__ predefined macro
The __BYTE_ORDER__ predefined macro was added in GCC 4.6:
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html
It's used like the following:
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
...
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
...
#else
#error insane architecture like the pdp-11
#endif
There's a similar macro, __FLOAT_WORD_ORDER__, but it looks like it
mainly exist to accommodate fairly obscure architectures and ARM's
old FPA instructions, so it doesn't seem nearly as useful.
The tests are updated to check for the correct(at least, based on
clang's current output) value of the macro on each target. So now the
suite will catch bugs like the one fixed in r157626.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/ConvertUTF.c')
0 files changed, 0 insertions, 0 deletions