From 51356f864933f664f7dfbf6e25ddcd97b587441a Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 16 Nov 1994 21:10:09 +0000 Subject: Check target endianness at run time, not compile time git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8470 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/real.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'gcc/real.h') diff --git a/gcc/real.h b/gcc/real.h index 34d6d678389..424264196e6 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -260,19 +260,19 @@ do { float f = (float) (IN); \ values which is its bitwise equivalent, but put the two words into proper word order for the target. */ #ifndef REAL_VALUE_TO_TARGET_DOUBLE -#if HOST_FLOAT_WORDS_BIG_ENDIAN == FLOAT_WORDS_BIG_ENDIAN #define REAL_VALUE_TO_TARGET_DOUBLE(IN, OUT) \ do { REAL_VALUE_TYPE in = (IN); /* Make sure it's not in a register. */\ - (OUT)[0] = ((long *) &in)[0]; \ - (OUT)[1] = ((long *) &in)[1]; \ + if (HOST_FLOAT_WORDS_BIG_ENDIAN == FLOAT_WORDS_BIG_ENDIAN) \ + { \ + (OUT)[0] = ((long *) &in)[0]; \ + (OUT)[1] = ((long *) &in)[1]; \ + } \ + else \ + { \ + (OUT)[1] = ((long *) &in)[0]; \ + (OUT)[0] = ((long *) &in)[1]; \ + } \ } while (0) -#else -#define REAL_VALUE_TO_TARGET_DOUBLE(IN, OUT) \ -do { REAL_VALUE_TYPE in = (IN); /* Make sure it's not in a register. */\ - (OUT)[1] = ((long *) &in)[0]; \ - (OUT)[0] = ((long *) &in)[1]; \ - } while (0) -#endif #endif #endif /* HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT */ -- cgit v1.2.1