>From 8db8baf111ec25370e1123b300e629c0be6490dd Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 21 Aug 2012 15:31:16 +0100 Subject: [PATCH] Fix compilation with mingw-w64 w32api headers - GUID_SECT was only ever needed for gcc pre-2.95 - Wrap 'Status' when including objbase.h - Include propkey.h, propsys.h rather than defining necessary stuff ourselves Signed-off-by: Jon TURNEY --- hw/xwin/ddraw.h | 4 ++++ hw/xwin/taskbar.h | 9 +++++++++ hw/xwin/winshaddd.c | 2 +- hw/xwin/winshadddnl.c | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/xwin/ddraw.h b/hw/xwin/ddraw.h index 9463049..fade730 100644 --- a/hw/xwin/ddraw.h +++ b/hw/xwin/ddraw.h @@ -3,7 +3,11 @@ #include #include +#pragma push_macro("Status") +#undef Status +#define Status wStatus #include +#pragma pop_macro("Status") #if defined(NONAMELESSUNION) && !defined(DUMMYUNIONNAME1) #define DUMMYUNIONNAME1 u1 diff --git a/hw/xwin/taskbar.h b/hw/xwin/taskbar.h index bfe301d..06c2f5d 100644 --- a/hw/xwin/taskbar.h +++ b/hw/xwin/taskbar.h @@ -31,6 +31,13 @@ #include +#ifdef __MINGW64_VERSION_MAJOR +/* If we are using headers from mingw-w64 project, it provides the PSDK headers this needs ... */ +#include +#include +#else /* !__MINGW64_VERSION_MAJOR */ +/* ... otherwise, we need to define all this stuff ourselves */ + typedef struct _tagpropertykey { GUID fmtid; DWORD pid; @@ -66,6 +73,8 @@ DEFINE_GUID(IID_IPropertyStore,0x886d8eeb, 0x8cf2, 0x4446, 0x8d,0x02, 0xcd,0xba, DEFINE_PROPERTYKEY(PKEY_AppUserModel_ID, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 5); +#endif /* !__MINGW64_VERSION_MAJOR */ + typedef HRESULT (__stdcall *SHGETPROPERTYSTOREFORWINDOWPROC)(HWND,REFIID,void**); typedef HRESULT (__stdcall *PROPVARIANTCLEARPROC)(PROPVARIANT*); diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index a2aaa39..cab451a 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -42,7 +42,7 @@ */ #ifdef DEFINE_GUID #undef DEFINE_GUID -#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} +#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} #endif /* DEFINE_GUID */ /* diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index f748c4d..b4720b2 100644 --- a/hw/xwin/winshadddnl.c +++ b/hw/xwin/winshadddnl.c @@ -42,7 +42,7 @@ */ #ifdef DEFINE_GUID #undef DEFINE_GUID -#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} +#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} #endif /* DEFINE_GUID */ /* -- 1.7.9