[ITA] w32api-3.0b_svn5368-1

Jon TURNEY jon.turney@dronecode.org.uk
Thu Aug 23 18:45:00 GMT 2012


On 21/08/2012 23:26, JonY wrote:
> On 8/22/2012 02:58, Yaakov (Cygwin/X) wrote:
>> Once we get past those, there are a few more:

This is what I get for only checking git master :S

>> In file included from winmultiwindowwm.c:74:0:
>> taskbar.h:34:16: error: redefinition of ‘struct _tagpropertykey’
>> /usr/include/w32api/wtypes.h:762:16: note: originally defined here
>> taskbar.h:37:3: error: conflicting types for ‘PROPERTYKEY’
>> /usr/include/w32api/wtypes.h:765:3: note: previous declaration of
>> ‘PROPERTYKEY’ was here
>> taskbar.h:39:0: warning: "REFPROPVARIANT" redefined
>> /usr/include/w32api/propidl.h:266:0: note: this is the location of the
>> previous definition
>> In file included from winmultiwindowwm.c:74:0:
>> taskbar.h:67:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
>> before ‘const’
>>
>> winmultiwindowwm.c: In function ‘winSetAppID’:
>> winmultiwindowwm.c:2064:44: error: ‘PKEY_AppUserModel_ID’ undeclared
>> (first use in this function)
>>
>> This would appear to be fixable by using <propkey.h> in
>> hw/xwin/taskbar.h instead of defining this stuff ourselves, but that
>> header is _W64-specific.
> 
> The header details are actually scrapped from MSDN.

It's nice to have more up-to-date PSDK headers.

But, I'm guessing that the issue Yaakov is alluding to here is that
mingw.org's w32api doesn't have a propkey.h, so I would be reluctant to
upstream a patch which unconditionally included propkey.h.

Putatively, the X.org source is compilable using a MinGW toolchain to produce
a native X server, and this would break that for anyone still using the
mingw.org toolchain.

Fortunately, this seems fixable if we can check we are using mingw-w64 or
mingw.org headers .  I'm told that checking for __MINGW64_VERSION_MAJOR is the
defined way to do this.

Yaakov, you might like to try the attached patch.  With an appropriate change
to prevent BOOL redefinition errors, this builds X server for me.

-------------- next part --------------
>From 8db8baf111ec25370e1123b300e629c0be6490dd Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.turney@dronecode.org.uk>
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 <jon.turney@dronecode.org.uk>
---
 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 <winnt.h>
 #include <wingdi.h>
+#pragma push_macro("Status")
+#undef Status
+#define Status wStatus
 #include <objbase.h>
+#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 <windows.h>
 
+#ifdef __MINGW64_VERSION_MAJOR
+/* If we are using headers from mingw-w64 project, it provides the PSDK headers this needs ... */
+#include <propkey.h>
+#include <propsys.h>
+#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



More information about the Cygwin-apps mailing list