diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 1994-11-16 21:10:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 1994-11-16 21:10:09 +0000 |
commit | f76b9db2874507ed287d1fe39ca2b1e89ae95207 (patch) | |
tree | 036743ae971e4dddc0469a67fd6d6272b0801af8 /gcc/libgcc2.c | |
parent | 1942e820686abbdd62515895e219476c26429945 (diff) | |
download | gcc-f76b9db2874507ed287d1fe39ca2b1e89ae95207.zip gcc-f76b9db2874507ed287d1fe39ca2b1e89ae95207.tar.gz gcc-f76b9db2874507ed287d1fe39ca2b1e89ae95207.tar.bz2 |
Check target endianness at run time, not compile time
From-SVN: r8470
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r-- | gcc/libgcc2.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 63a7114..247b835 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -40,6 +40,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef abort #endif +/* Permit the tm.h file to select the endianness to use just for this + file. This is used when the endianness is determined when the + compiler is run. */ + +#ifndef LIBGCC2_WORDS_BIG_ENDIAN +#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN +#endif + /* In the first part of this file, we are interfacing to calls generated by the compiler itself. These calls pass values into these routines which have very specific modes (rather than very specific types), and @@ -90,9 +98,9 @@ typedef int word_type __attribute__ ((mode (DI))); #define SI_TYPE_SIZE (sizeof (SItype) * BITS_PER_UNIT) /* DIstructs are pairs of SItype values in the order determined by - WORDS_BIG_ENDIAN. */ + LIBGCC2_WORDS_BIG_ENDIAN. */ -#if WORDS_BIG_ENDIAN +#if LIBGCC2_WORDS_BIG_ENDIAN struct DIstruct {SItype high, low;}; #else struct DIstruct {SItype low, high;}; |