Erik van Pienbroek schreef op di 10-09-2013 om 20:25 [+0200]:
> qt5-qtbase:
> -----------
> 
> /builddir/build/BUILD/qtbase-opensource-src-5.1.1/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp:236:8:
>  error: redefinition of 'struct IEnumShellItems'
>  DECLARE_INTERFACE_(IEnumShellItems, IUnknown)
>         ^
> In file included
> from /usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:100:0,
> 
> from 
> /builddir/build/BUILD/qtbase-opensource-src-5.1.1/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp:70:
> /usr/i686-w64-mingw32/sys-root/mingw/include/shobjidl.h:10605:1: error:
> previous definition of 'struct IEnumShellItems'
>  IEnumShellItems : public IUnknown
>  ^
> 
> This is still the same as in the previous test run. I'm doing more
> research into this one now

I've finished my research on this one and came up with a patch for
qt5-qtbase (attached). The annoying part is that this patch can't be
properly upstreamed. The last part of the patch breaks compilation
against older mingw-w64 snapshots. This is due to a change which was
done in r6215: http://sourceforge.net/p/mingw-w64/code/6215/

In this commit the prototype for the symbol SHGetPathFromIDList get
changed (the argument 'LPCITEMIDLIST pidl' got changed to
'PCIDLIST_ABSOLUTE pidl'). The qt5 folks used to work-around the invalid
function prototype in the past but now that mingw-w64 is implementing
things correctly this workaround breaks stuff. As there are no macros
inside mingw-w64 which identify the svn revision all I could came up
with is a '__MINGW64_VERSION_MAJOR < 3' conditional as best possible
solution.

Regards,

Erik

--- ./src/plugins/platforms/windows/qwindowsdialoghelpers.cpp.orig	2013-09-11 21:07:57.341841134 +0200
+++ ./src/plugins/platforms/windows/qwindowsdialoghelpers.cpp	2013-09-11 21:51:50.500731008 +0200
@@ -39,6 +39,9 @@
 **
 ****************************************************************************/
 
+/* The structure FDAP which is used in this file is only available as of Windows Vista */
+#define _WIN32_WINNT 0x0600
+
 #include "qwindowsdialoghelpers.h"
 
 #include "qwindowscontext.h"
@@ -232,7 +235,7 @@
 };
 #endif
 
-#ifndef __IShellEnumItems_INTERFACE_DEFINED__
+#if !defined(__IShellEnumItems_INTERFACE_DEFINED__) && !defined(__IEnumShellItems_INTERFACE_DEFINED__)
 DECLARE_INTERFACE_(IEnumShellItems, IUnknown)
 {
     STDMETHOD(Next)(THIS_ ULONG celt, IShellItem **rgelt, ULONG *pceltFetched) PURE;
@@ -1710,7 +1713,9 @@
     return dialog->existingDirCallback(hwnd, uMsg, lParam);
 }
 
-#ifdef Q_CC_MINGW
+/* The correct declaration of the SHGetPathFromIDList symbol is
+ * being used in mingw-w64 as of r6215 (which is a v3 snapshot) */
+#if defined(Q_CC_MINGW) && __MINGW64_VERSION_MAJOR < 3
 typedef ITEMIDLIST *qt_LpItemIdList;
 #else
 typedef PIDLIST_ABSOLUTE qt_LpItemIdList;
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to