Fix build on MinGW after 0f14ea3f3a05ef785b44fa610bf90ff3b5ba7beb
authorKonstantin Ritt <ritt.ks@gmail.com>
Sat, 27 Oct 2012 11:52:42 +0000 (14:52 +0300)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 29 Oct 2012 17:22:29 +0000 (18:22 +0100)
Also generalize set _WIN32_WINNT to 0x0501 and _WIN32_IE to 0x0501 globally,
as it is out minimal requirement these days.

Change-Id: I8ca9102d49c37f908fd8ac032f707f8fe4fdcb22
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
src/corelib/global/qt_windows.h
src/plugins/platforms/windows/qwindowsdrag.cpp
src/widgets/itemviews/qfileiconprovider.cpp
src/widgets/util/qsystemtrayicon_win.cpp

index 4bd8d60..00a511a 100644 (file)
 // Borland's windows.h does not set these correctly, resulting in
 // unusable WinSDK standard dialogs
 #ifndef WINVER
-#define WINVER 0x400
+#  define WINVER 0x0501
 #endif
 #ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x400
+#  define _WIN32_WINNT 0x0501
 #endif
 #endif
 
 #if defined(Q_CC_MINGW)
 // mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation
 #ifndef WINVER
-#define WINVER 0x500
+#  define WINVER 0x501
 #endif
 #endif
 
 #endif
 #include <windows.h>
 
+#if defined(_WIN32_IE) && _WIN32_IE < 0x0501
+#  undef _WIN32_IE
+#endif
+#if !defined(_WIN32_IE)
+#  define _WIN32_IE 0x0501
+#endif
+
 #ifdef _WIN32_WCE
 #include <ceconfig.h>
 #endif
index a0434fb..805046c 100644 (file)
@@ -718,9 +718,6 @@ QWindowsOleDropTarget::Drop(LPDATAOBJECT pDataObj, DWORD grfKeyState,
     return NOERROR;
 }
 
-#if defined(Q_CC_MINGW) && !defined(_WIN32_IE)
-# define _WIN32_IE 0x0501
-#endif
 
 /*!
     \class QWindowsDrag
index 70750c6..d073867 100644 (file)
 #include <qpa/qplatformtheme.h>
 
 #if defined(Q_OS_WIN)
-#if defined(_WIN32_IE)
-#  undef _WIN32_IE
-#endif
-#  define _WIN32_IE 0x0500
 #  include <qt_windows.h>
 #  include <commctrl.h>
 #  include <objbase.h>
index 108e65a..896d5c2 100644 (file)
 #include "qsystemtrayicon_p.h"
 #ifndef QT_NO_SYSTEMTRAYICON
 
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
+#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600
+#  undef _WIN32_WINNT
+#endif
+#if !defined(_WIN32_WINNT)
+#  define _WIN32_WINNT 0x0600
 #endif
 
-#ifndef _WIN32_IE
-#define _WIN32_IE 0x600
+#if defined(_WIN32_IE) && _WIN32_IE < 0x0600
+#  undef _WIN32_IE
+#endif
+#if !defined(_WIN32_IE)
+#  define _WIN32_IE 0x0600 //required for NOTIFYICONDATA_V2_SIZE
 #endif
 
 #include <private/qsystemlibrary_p.h>