From 38eb679ebcc37d74b428b4f938d3b6f0f27bc9a8 Mon Sep 17 00:00:00 2001 From: jeblanchard Date: Sat, 31 May 2008 02:58:43 +0000 Subject: [PATCH] hacks to fix MinGW builds --- SConstruct | 3 ++- src/drivers/win/common.h | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 75b7c4cb..544b1e09 100644 --- a/SConstruct +++ b/SConstruct @@ -39,12 +39,13 @@ if env['PLATFORM'] == 'cygwin': conf = Configure(env) if env['PLATFORM'] == 'win32': conf.env.Append(CPPPATH = [".", "drivers/win/", "drivers/common/", "drivers/", "drivers/win/zlib", "drivers/win/directx"]) - conf.env.Append(CPPDEFINES = ["PSS_STYLE=2", "WIN32", "_USE_SHARED_MEMORY_", "NETWORK", "FCEUDEF_DEBUGGER", "NOMINMAX", "_WIN32_IE=0x0300"]) + conf.env.Append(CPPDEFINES = ["PSS_STYLE=2", "WIN32", "_USE_SHARED_MEMORY_", "NETWORK", "FCEUDEF_DEBUGGER", "NOMINMAX", "NEED_MINGW_HACKS", "_WIN32_IE=0x0600"]) conf.env.Append(LIBS = ["rpcrt4", "comctl32", "vfw32", "winmm", "ws2_32", "comdlg32", "ole32", "gdi32"]) if env.has_key('DEBUG'): if env['DEBUG']: conf.env.Append(CCFLAGS = " -g") conf.env.Append(CPPDEFINES = ["_DEBUG"]) + conf.env.Append(CCFLAGS = " -O3 -Wall") else: # Should we do this? conf.env.Append(CCFLAGS = " -O3 -fomit-frame-pointer") else: diff --git a/src/drivers/win/common.h b/src/drivers/win/common.h index c35c3d90..d617c15f 100644 --- a/src/drivers/win/common.h +++ b/src/drivers/win/common.h @@ -1,3 +1,6 @@ +#ifndef WIN_COMMON_H +#define WIN_COMMON_H + #include #include #include @@ -12,6 +15,20 @@ #define DIRECTSOUND_VERSION 0x0700 #define DIRECTDRAW_VERSION 0x0700 #define DIRECTINPUT_VERSION 0x700 + +#ifdef NEED_MINGW_HACKS +typedef struct _HD_HITTESTINFO HDHITTESTINFO; +// Pulled from wine's commctrl.h: +typedef struct tagNMLVODSTATECHANGE +{ + NMHDR hdr; + int iFrom; + int iTo; + UINT uNewState; + UINT uOldState; +} NMLVODSTATECHANGE, *LPNMLVODSTATECHANGE; +#endif + //#define FCEUDEF_DEBUGGER //mbg merge 7/17/06 removing conditional compiles #include "../../types.h" #include "../../file.h" @@ -44,4 +61,5 @@ extern int eoptions; #define EO_FORCEISCALE 16384 #define EO_NOFOURSCORE 32768 -bool directoryExists(const char* dirname); \ No newline at end of file +bool directoryExists(const char* dirname); +#endif