summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2017-09-28 23:54:32 +0300
committerOrgad Shaneh <orgads@gmail.com>2017-10-19 10:58:59 +0000
commitd57a7c41712f8627a462d893329dc3f0dbb52d32 (patch)
treeac0589c3aeba32384abcc506ddd5495ff6fe0c31 /src
parenta1c985c10bf2212e911777568c6e344456293a65 (diff)
MinGW: Globally define WINVER and _WIN32_WINNT to enable Windows 7 API
Change-Id: I637b33ba6d05f40486d8da927ae5cc5148299348 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/corelib.pro2
-rw-r--r--src/corelib/global/qt_windows.h4
-rw-r--r--src/network/kernel/kernel.pri2
-rw-r--r--src/network/kernel/qnetworkinterface_win.cpp1
-rw-r--r--src/plugins/bearer/generic/qgenericengine.cpp6
-rw-r--r--src/plugins/bearer/platformdefs_win.h1
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp4
-rw-r--r--src/widgets/kernel/win.pri2
10 files changed, 14 insertions, 16 deletions
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 7f018bdb94..6dc11e1a4d 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -50,8 +50,6 @@ win32 {
mingw {
# otherwise mingw headers do not declare common functions like putenv
CONFIG -= strict_c++
- # Override MinGW's definition in _mingw.h
- DEFINES += WINVER=0x600 _WIN32_WINNT=0x0600
}
LIBS_PRIVATE += -lws2_32
!winrt {
diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h
index bc48104edc..67ba27f072 100644
--- a/src/corelib/global/qt_windows.h
+++ b/src/corelib/global/qt_windows.h
@@ -48,10 +48,10 @@
#if defined(Q_CC_MINGW)
// mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation
# ifndef WINVER
-# define WINVER 0x600
+# define WINVER 0x601
# endif
# ifndef _WIN32_WINNT
-# define _WIN32_WINNT 0x600
+# define _WIN32_WINNT 0x601
# endif
# ifndef NTDDI_VERSION
# define NTDDI_VERSION 0x06000000
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index 716f745bc9..54b61f3ad3 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -49,8 +49,6 @@ win32: {
SOURCES += kernel/qdnslookup_win.cpp \
kernel/qnetworkinterface_win.cpp
LIBS_PRIVATE += -ldnsapi -liphlpapi
- DEFINES += WINVER=0x0600 _WIN32_WINNT=0x0600
-
} else {
SOURCES += kernel/qdnslookup_winrt.cpp \
kernel/qnetworkinterface_winrt.cpp
diff --git a/src/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp
index 8344fb04c2..64c3fa6f83 100644
--- a/src/network/kernel/qnetworkinterface_win.cpp
+++ b/src/network/kernel/qnetworkinterface_win.cpp
@@ -56,6 +56,7 @@
// (http://sourceforge.net/p/mingw-w64/mailman/message/32935366/)
#include <winsock2.h>
#include <ws2ipdef.h>
+#include <wincrypt.h>
#include <iphlpapi.h>
#include <ws2tcpip.h>
diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp
index cd3b202001..7b0aa52831 100644
--- a/src/plugins/bearer/generic/qgenericengine.cpp
+++ b/src/plugins/bearer/generic/qgenericengine.cpp
@@ -55,10 +55,10 @@
#if defined(Q_OS_WIN32)
// PMIB_TCPTABLE2 is only available since Vista
-#if _WIN32_WINNT < 0x0600
+#if _WIN32_WINNT < 0x0601
# undef _WIN32_WINNT
-# define _WIN32_WINNT 0x0600
-#endif // _WIN32_WINNT < 0x0600
+# define _WIN32_WINNT 0x0601
+#endif // _WIN32_WINNT < 0x0601
#include "../platformdefs_win.h"
#include <iphlpapi.h>
#endif
diff --git a/src/plugins/bearer/platformdefs_win.h b/src/plugins/bearer/platformdefs_win.h
index 5a8487d868..0477dc45c3 100644
--- a/src/plugins/bearer/platformdefs_win.h
+++ b/src/plugins/bearer/platformdefs_win.h
@@ -45,6 +45,7 @@
#include <winsock2.h>
#include <mswsock.h>
#undef interface
+#include <wincrypt.h>
#include <winioctl.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index c4aeb15bd1..26779f0c01 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -39,7 +39,9 @@
#define QT_NO_URL_CAST_FROM_STRING 1
-#define _WIN32_WINNT 0x0600
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0601
+#endif
#include "qwindowscombase.h"
#include "qwindowsdialoghelpers.h"
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index 2b14edc804..9544fb81f7 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -60,7 +60,7 @@
* are present in the Windows SDK's, but not in older MSVC Express
* versions. */
-#if defined(Q_CC_MINGW) || !defined(TOUCHEVENTF_MOVE)
+#if !defined(TOUCHEVENTF_MOVE)
typedef struct tagTOUCHINPUT {
LONG x;
@@ -85,7 +85,7 @@ typedef TOUCHINPUT const * PCTOUCHINPUT;
# define TOUCHEVENTF_PALM 0x0080
# define TOUCHINPUTMASKF_CONTACTAREA 0x0004
# define TOUCHINPUTMASKF_EXTRAINFO 0x0002
-#endif // if defined(Q_CC_MINGW) || !defined(TOUCHEVENTF_MOVE)
+#endif // if !defined(TOUCHEVENTF_MOVE)
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index a1ccf1f83c..651c661d6b 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -38,9 +38,9 @@
****************************************************************************/
// SHSTOCKICONINFO is only available since Vista
-#if _WIN32_WINNT < 0x0600
+#if _WIN32_WINNT < 0x0601
# undef _WIN32_WINNT
-# define _WIN32_WINNT 0x0600
+# define _WIN32_WINNT 0x0601
#endif
#include "qwindowstheme.h"
diff --git a/src/widgets/kernel/win.pri b/src/widgets/kernel/win.pri
index 7cef2d14a8..f6877b02db 100644
--- a/src/widgets/kernel/win.pri
+++ b/src/widgets/kernel/win.pri
@@ -3,5 +3,3 @@
INCLUDEPATH += ../3rdparty/wintab
!winrt: LIBS_PRIVATE *= -lshell32 -luxtheme -ldwmapi
-# Override MinGW's definition in _mingw.h
-mingw: DEFINES += WINVER=0x600 _WIN32_WINNT=0x0600