diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-26 20:03:21 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-26 20:03:21 +0000 |
commit | c79b54af83c8031caac515081fb7c56a127b90e3 (patch) | |
tree | e5391ba973e0b1e273c9037981ed8ac55099e03f /gcc/cppbuiltin.c | |
parent | 8dfbafc807ba917d346d622915073bd4450ad344 (diff) | |
download | gcc-c79b54af83c8031caac515081fb7c56a127b90e3.tar.gz |
2010-10-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 165980
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@165983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppbuiltin.c')
-rw-r--r-- | gcc/cppbuiltin.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cppbuiltin.c b/gcc/cppbuiltin.c index 89b0f418be6..7ac4071c322 100644 --- a/gcc/cppbuiltin.c +++ b/gcc/cppbuiltin.c @@ -138,6 +138,24 @@ define_builtin_macros_for_type_sizes (cpp_reader *pfile) cpp_define_formatted (pfile, "__BIGGEST_ALIGNMENT__=%d", BIGGEST_ALIGNMENT / BITS_PER_UNIT); + /* Define constants useful for implementing endian.h. */ + cpp_define (pfile, "__ORDER_LITTLE_ENDIAN__=1234"); + cpp_define (pfile, "__ORDER_BIG_ENDIAN__=4321"); + cpp_define (pfile, "__ORDER_PDP_ENDIAN__=3412"); + + if (WORDS_BIG_ENDIAN == BYTES_BIG_ENDIAN) + cpp_define_formatted (pfile, "__BYTE_ORDER__=%s", + (WORDS_BIG_ENDIAN + ? "__ORDER_BIG_ENDIAN__" + : "__ORDER_LITTLE_ENDIAN__")); + else + { + /* Assert that we're only dealing with the PDP11 case. */ + gcc_assert (!BYTES_BIG_ENDIAN && WORDS_BIG_ENDIAN); + + cpp_define (pfile, "__BYTE_ORDER__=__ORDER_PDP_ENDIAN__"); + } + /* ptr_type_node can't be used here since ptr_mode is only set when toplev calls backend_init which is not done with -E switch. */ cpp_define_formatted (pfile, "__SIZEOF_POINTER__=%d", |