From bebab7f24f9bbc661ae7f33c7a3f2f7785e6b088 Mon Sep 17 00:00:00 2001 From: Ruslan Bukin Date: Fri, 3 Apr 2015 11:42:10 -0500 Subject: [PATCH] sim: correct check for endianess Committed by: Nilay Vaish --- src/sim/byteswap.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 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 inline T htole(T value) {return swap_byte(value);} template inline T letoh(T value) {return swap_byte(value);} -- 2.30.2