MinGW: Globally define WINVER and _WIN32_WINNT to enable Windows 7 API
Change-Id: I637b33ba6d05f40486d8da927ae5cc5148299348 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
a1c985c10b
commit
d57a7c4171
@ -100,6 +100,9 @@ unix: CONFIG += explicitlib
|
||||
# By default we want tests on macOS to be built as standalone executables
|
||||
macos: CONFIG += testcase_no_bundle
|
||||
|
||||
# Override MinGW's definition in _mingw.h
|
||||
mingw: DEFINES += WINVER=0x0601 _WIN32_WINNT=0x0601
|
||||
|
||||
defineTest(qtBuildPart) {
|
||||
bp = $$eval($$upper($$section(_QMAKE_CONF_, /, -2, -2))_BUILD_PARTS)
|
||||
isEmpty(bp): bp = $$QT_BUILD_PARTS
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <winsock2.h>
|
||||
#include <mswsock.h>
|
||||
#undef interface
|
||||
#include <wincrypt.h>
|
||||
#include <winioctl.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -8,7 +8,4 @@ QT = core-private network-private testlib
|
||||
|
||||
win32:LIBS += -lws2_32
|
||||
|
||||
# needed for getaddrinfo with official MinGW
|
||||
mingw:DEFINES += _WIN32_WINNT=0x0501
|
||||
|
||||
winrt: WINRT_MANIFEST.capabilities += internetClientServer
|
||||
|
Loading…
x
Reference in New Issue
Block a user