summaryrefslogtreecommitdiff
path: root/sim/byteswap.hh
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-02-15 01:23:13 -0500
committerAli Saidi <saidi@eecs.umich.edu>2006-02-15 01:23:13 -0500
commit18a0fa3e0c19e1afaf1dedb3d5a3b14a2c3aa3c7 (patch)
treed2df59785f910ac7d285ac4591a15dda8c01bf49 /sim/byteswap.hh
parent79613686f0f6a8725e88e935a7c9ff4ede4cfc2b (diff)
downloadgem5-18a0fa3e0c19e1afaf1dedb3d5a3b14a2c3aa3c7.tar.xz
endian fixes and compiles on mac os x
arch/alpha/alpha_linux_process.cc: add endian conversions for fstat functions arch/alpha/alpha_tru64_process.cc: add endian conversions for various functions sim/byteswap.hh: for some reason gcc on macos really wants long and unsigned long Why int32_t and uint32_t isn't sufficient I don't know. sim/process.cc: sim/syscall_emul.hh: endian fixes --HG-- extra : convert_revision : ce625d5660b70867c43c74fbed856149c0d8cd36
Diffstat (limited to 'sim/byteswap.hh')
-rw-r--r--sim/byteswap.hh6
1 files changed, 5 insertions, 1 deletions
diff --git a/sim/byteswap.hh b/sim/byteswap.hh
index 6a98a987f..c5d8801ab 100644
--- a/sim/byteswap.hh
+++ b/sim/byteswap.hh
@@ -79,7 +79,11 @@ static inline uint64_t swap_byte(uint64_t x) {return swap_byte64(x);}
static inline int64_t swap_byte(int64_t x) {return swap_byte64((uint64_t)x);}
static inline uint32_t swap_byte(uint32_t x) {return swap_byte32(x);}
static inline int32_t swap_byte(int32_t x) {return swap_byte32((uint32_t)x);}
-static inline int32_t swap_byte(long x) {return swap_byte32((long)x);}
+#if defined(__APPLE__)
+static inline long swap_byte(long x) {return swap_byte32((long)x);}
+static inline unsigned long swap_byte(unsigned long x)
+ { return swap_byte32((unsigned long)x);}
+#endif
static inline uint16_t swap_byte(uint16_t x) {return swap_byte32(x);}
static inline int16_t swap_byte(int16_t x) {return swap_byte16((uint16_t)x);}
static inline uint8_t swap_byte(uint8_t x) {return x;}