#define __SIM_BYTE_SWAP_HH__
#include "base/bigint.hh"
-#include "base/misc.hh"
#include "base/types.hh"
// This lets us figure out what the byte order of the host system is
#include <libkern/OSByteOrder.h>
#endif
-enum ByteOrder {BigEndianByteOrder, LittleEndianByteOrder};
-
//These functions actually perform the swapping for parameters
//of various bit lengths
inline uint64_t
//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);}