From 79e97e339e0118aa5d92722648e3170a30d63202 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 2 Nov 2013 19:31:26 +0000 Subject: [PATCH] fix windows compiling --- desmume/src/NDSSystem.cpp | 1 + desmume/src/arm_jit.cpp | 5 ++++- desmume/src/types.h | 16 ++++++++++++---- desmume/src/utils/fsnitro.cpp | 2 ++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index e5b3798ce..5aceea297 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -506,6 +506,7 @@ void GameInfo::closeROM() u32 GameInfo::readROM(u32 pos) { + //TODO - this should not be done here! it's a property of the slot-1 device, not the rom! if ((pos < 0x8000) && (pos >= 0x4000)) return *(u32*)(secureArea + (pos - 0x4000)); diff --git a/desmume/src/arm_jit.cpp b/desmume/src/arm_jit.cpp index 8152ab348..d5f66fdcc 100644 --- a/desmume/src/arm_jit.cpp +++ b/desmume/src/arm_jit.cpp @@ -17,11 +17,13 @@ */ #include "types.h" + #ifdef HAVE_JIT #if !defined(HOST_32) && !defined(HOST_64) #error "ERROR: JIT compiler - unsupported target platform" #endif -#ifdef _WINDOWS + +#ifdef HOST_WINDOWS // **** Windows port #else #include @@ -30,6 +32,7 @@ #include #define HAVE_STATIC_CODE_BUFFER #endif + #include "instructions.h" #include "instruction_attributes.h" #include "Disassembler.h" diff --git a/desmume/src/types.h b/desmume/src/types.h index 72c333485..39881f433 100644 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -21,10 +21,18 @@ //analyze microsoft compilers #ifdef _MSC_VER -#define HOST_WINDOWS -//todo - everyone will want to support this eventually, i suppose -#include "config.h" -#endif + #define HOST_WINDOWS + + #if defined(__x86_64__) || defined(__LP64) || defined(__IA64__) || defined(_M_X64) || defined(_WIN64) + #define HOST_64 + #else + #define HOST_32 + #endif + + //todo - everyone will want to support this eventually, i suppose + #include "config.h" + +#endif //_MSC_VER //enforce a constraint: gdb stub requires developer #if defined(GDB_STUB) && !defined(DEVELOPER) diff --git a/desmume/src/utils/fsnitro.cpp b/desmume/src/utils/fsnitro.cpp index 36cd4c2e4..40e609348 100644 --- a/desmume/src/utils/fsnitro.cpp +++ b/desmume/src/utils/fsnitro.cpp @@ -15,6 +15,8 @@ along with the this software. If not, see . */ +#include "types.h" + #include #include #ifdef HOST_WINDOWS