summaryrefslogtreecommitdiff
path: root/src/sim/byteswap.hh
diff options
context:
space:
mode:
authorRuslan Bukin <br@bsdpad.com>2015-04-03 11:42:10 -0500
committerRuslan Bukin <br@bsdpad.com>2015-04-03 11:42:10 -0500
commitbebab7f24f9bbc661ae7f33c7a3f2f7785e6b088 (patch)
tree23e545adb1ab63a5b5f2238ffa26918b95123dcd /src/sim/byteswap.hh
parentb3314673f456a9686559ec95cbee2302c3214921 (diff)
downloadgem5-bebab7f24f9bbc661ae7f33c7a3f2f7785e6b088.tar.xz
sim: correct check for endianess
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/sim/byteswap.hh')
-rw-r--r--src/sim/byteswap.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sim/byteswap.hh b/src/sim/byteswap.hh
index db630bd22..b46c1e552 100644
--- a/src/sim/byteswap.hh
+++ b/src/sim/byteswap.hh
@@ -149,7 +149,7 @@ template <typename T> inline T letobe(T value) {return swap_byte(value);}
//For conversions not involving the guest system, we can define the functions
//conditionally based on the BYTE_ORDER macro and outside of the namespaces
-#if defined(_BIG_ENDIAN) || !defined(_LITTLE_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
+#if (defined(_BIG_ENDIAN) || !defined(_LITTLE_ENDIAN)) && BYTE_ORDER == BIG_ENDIAN
const ByteOrder HostByteOrder = BigEndianByteOrder;
template <typename T> inline T htole(T value) {return swap_byte(value);}
template <typename T> inline T letoh(T value) {return swap_byte(value);}