From 4c951d1b043c8ee14603ffdc6704962280df40d6 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Sun, 26 Jun 2011 21:29:02 +0000 Subject: [PATCH] Small fix to allow app.cpp to compile on win32. --- src/gui/app.cpp | 3 +++ src/memory.cpp | 2 ++ src/memory.h | 1 + 3 files changed, 6 insertions(+) diff --git a/src/gui/app.cpp b/src/gui/app.cpp index 1e36fe4..bb0f924 100644 --- a/src/gui/app.cpp +++ b/src/gui/app.cpp @@ -20,6 +20,9 @@ #include "mainwin.h" #include "types.h" +// Apparently on other archs, SDL is hijacking main, so let's do this: +#undef main + // Here's the main application loop--short and simple... int main(int argc, char * argv[]) { diff --git a/src/memory.cpp b/src/memory.cpp index c1b299a..0343f61 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -148,6 +148,8 @@ uint32 butch, dscntrl, ds_data, i2cntrl, sbcntrl, subdata, subdatb, sb_time, fif //this isn't endian safe... #define BSWAP64(x) ((htonl(x & 0xFFFFFFFF) << 32) | htonl(x >> 32)) // Actually, we use ESAFExx() macros instead of this, and we use GCC to check the endianness... +// Acutally, considering that "byteswap.h" doesn't exist elsewhere, the above +// is probably our best bet here. Just need to rename them to ESAFExx(). uint16 & memcon1 = *((uint16 *)&jagMemSpace[0xF00000]); uint16 & memcon2 = *((uint16 *)&jagMemSpace[0xF00002]); diff --git a/src/memory.h b/src/memory.h index 78fb3b8..900325e 100644 --- a/src/memory.h +++ b/src/memory.h @@ -88,6 +88,7 @@ extern const char * whoName[9]; #define GET16(r, a) ((r[(a)] << 8) | r[(a)+1]) //This doesn't seem to work on OSX. So have to figure something else out. :-( +//byteswap.h doesn't exist on OSX. #if 0 // This is GCC specific, but we can fix that if we need to... // Big plus of this approach is that these compile down to single instructions on little -- 2.37.2