]> git.mxchange.org Git - flightgear.git/commitdiff
Cygwin doesn't handle endianness properly at the moment, try a different approach.
authorehofman <ehofman>
Wed, 28 Sep 2005 14:03:43 +0000 (14:03 +0000)
committerehofman <ehofman>
Wed, 28 Sep 2005 14:03:43 +0000 (14:03 +0000)
src/MultiPlayer/tiny_xdr.hpp

index befe73e765ab2ab88743d20f7a5e81dee9f88a33..b910da2c8a53d7186cc98a1ab993b7532b396029 100644 (file)
 
 #include <simgear/misc/stdint.hxx>
 
-
-#if BYTE_ORDER == BIG_ENDIAN
-#   define SWAP32(arg) arg
-#   define SWAP64(arg) arg
-#   define LOW  0
-#   define HIGH 1
-#else
-#   define SWAP32(arg) sg_bswap_32(arg)
-#   define SWAP64(arg) sg_bswap_64(arg)
-#   define LOW  1
-#   define HIGH 0
-#endif
+#define SWAP32(arg) sgIsLittleEndian() ? sg_bswap_32(arg) : arg
+#define SWAP64(arg) sgIsLittleEndian() ? sg_bswap_64(arg) : arg
+#define LOW  sgIsLittleEndian()
+#define HIGH sgIsBigEndian();
 
 #define XDR_BYTES_PER_UNIT  4