Bump WINVER, _WIN32_WINNT and _WIN32_IE to _WIN32_WINNT_WIN10 (0x0A00)

And bump NTDDI_VERSION to 0x0A00000B (NTDDI_WIN10_CO) at the same time,
to unblock the developers from accessing the latest Windows APIs.

Pick-to: 6.2
Change-Id: Ifbc28c8f8b073866871685c020301f5f20dc9591
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Yuhang Zhao 2021-10-17 11:19:48 +08:00
parent a8be40bd64
commit 6652bf2353
13 changed files with 58 additions and 55 deletions

View File

@ -138,9 +138,34 @@ VERS_1;
set(TEST_ld_version_script "${HAVE_LD_VERSION_SCRIPT}" CACHE INTERNAL "linker version script support")
endfunction()
function(qt_internal_ensure_latest_win_nt_api)
if(NOT WIN32)
return()
endif()
check_cxx_source_compiles([=[
#include <windows.h>
#if !defined(_WIN32_WINNT) && !defined(WINVER)
#error "_WIN32_WINNT and WINVER are not defined"
#endif
#if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0A00)
#error "_WIN32_WINNT version too low"
#endif
#if defined(WINVER) && (WINVER < 0x0A00)
#error "WINVER version too low"
#endif
int main() { return 0; }
]=] HAVE_WIN10_WIN32_WINNT)
if(NOT HAVE_WIN10_WIN32_WINNT)
list(APPEND QT_PLATFORM_DEFINITIONS _WIN32_WINNT=0x0A00 WINVER=0x0A00)
set(QT_PLATFORM_DEFINITIONS ${QT_PLATFORM_DEFINITIONS}
CACHE STRING "Qt platform specific pre-processor defines" FORCE)
endif()
endfunction()
function(qt_run_qtbase_config_tests)
qt_run_config_test_architecture()
qt_run_linker_version_script_support()
qt_internal_ensure_latest_win_nt_api()
endfunction()
# The qmake build of android does not perform the right architecture tests and

View File

@ -310,7 +310,7 @@ if(WIN32)
endif()
if (MINGW)
list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS _WIN32_WINNT=0x0601 MINGW_HAS_SECURE_API=1)
list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS MINGW_HAS_SECURE_API=1)
endif()
elseif(LINUX)
if(GCC)

View File

@ -345,4 +345,9 @@ msvc {
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += /GUARD:CF
}
win32 {
DEFINES *= _WIN32_WINNT=0x0A00
DEFINES *= WINVER=0x0A00
}
TARGET = $$qt5LibraryTarget($$TARGET$$QT_LIBINFIX) # Do this towards the end

View File

@ -45,17 +45,17 @@
#pragma qt_sync_stop_processing
#endif
#if defined(Q_CC_MINGW)
// mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation
# ifndef WINVER
# define WINVER 0x601
# endif
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x601
# endif
# ifndef NTDDI_VERSION
# define NTDDI_VERSION 0x06010000
# endif
#ifndef WINVER
# define WINVER 0x0A00 // _WIN32_WINNT_WIN10
#endif
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0A00
#endif
#ifndef _WIN32_IE
# define _WIN32_IE 0x0A00
#endif
#ifndef NTDDI_VERSION
# define NTDDI_VERSION 0x0A00000B // NTDDI_WIN10_CO
#endif
#ifndef NOMINMAX
@ -63,13 +63,6 @@
#endif
#include <windows.h>
#if defined(_WIN32_IE) && _WIN32_IE < 0x0501
# undef _WIN32_IE
#endif
#if !defined(_WIN32_IE)
# define _WIN32_IE 0x0501
#endif
// already defined when compiled with WINVER >= 0x0500
#ifndef SPI_SETMENUANIMATION
#define SPI_SETMENUANIMATION 0x1003

View File

@ -627,15 +627,6 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
return QFileSystemEntry(ret, QFileSystemEntry::FromInternalPath());
}
#if defined(Q_CC_MINGW) && WINVER < 0x0602 && _WIN32_WINNT < _WIN32_WINNT_WIN8 // Windows 8 onwards
typedef struct _FILE_ID_INFO {
ULONGLONG VolumeSerialNumber;
FILE_ID_128 FileId;
} FILE_ID_INFO, *PFILE_ID_INFO;
#endif // if defined(Q_CC_MINGW) && WINVER < 0x0602 && _WIN32_WINNT < _WIN32_WINNT_WIN8
// File ID for Windows up to version 7 and FAT32 drives
static inline QByteArray fileId(HANDLE handle)
{

View File

@ -46,7 +46,7 @@
#if defined(Q_CC_MINGW) || defined(Q_CC_CLANG)
# define HAS_UI_VIEW_SETTINGS_INTEROP
// Present from MSVC2015 + SDK 10 onwards
#elif (!defined(Q_CC_MSVC) || _MSC_VER >= 1900) && NTDDI_VERSION >= 0xa000000
#elif (!defined(Q_CC_MSVC) || _MSC_VER >= 1900) && WINVER >= 0x0A00
# define HAS_UI_VIEW_SETTINGS_INTEROP
# define HAS_UI_VIEW_SETTINGS
#endif

View File

@ -40,7 +40,7 @@
#define QT_NO_URL_CAST_FROM_STRING 1
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0601
#define _WIN32_WINNT 0x0A00
#endif
#include "qwindowscombase.h"

View File

@ -37,11 +37,8 @@
**
****************************************************************************/
#if defined(WINVER) && WINVER < 0x0603
# undef WINVER
#endif
#if !defined(WINVER)
# define WINVER 0x0603 // Enable pointer functions for MinGW
#ifndef WINVER
# define WINVER 0x0A00 // Enable pointer functions for MinGW
#endif
#include "qwindowspointerhandler.h"

View File

@ -37,18 +37,12 @@
**
****************************************************************************/
#if defined(WINVER) && WINVER < 0x0601
# undef WINVER
#endif
#if !defined(WINVER)
# define WINVER 0x0601 // required for NOTIFYICONDATA_V2_SIZE, ChangeWindowMessageFilterEx() (MinGW 5.3)
#ifndef WINVER
# define WINVER 0x0A00 // required for NOTIFYICONDATA_V2_SIZE, ChangeWindowMessageFilterEx() (MinGW 5.3)
#endif
#if defined(NTDDI_VERSION) && NTDDI_VERSION < 0x06010000
# undef NTDDI_VERSION
#endif
#if !defined(NTDDI_VERSION)
# define NTDDI_VERSION 0x06010000 // required for Shell_NotifyIconGetRect (MinGW 5.3)
#ifndef NTDDI_VERSION
# define NTDDI_VERSION 0x0A00000B // required for Shell_NotifyIconGetRect (MinGW 5.3)
#endif
#include "qwindowssystemtrayicon.h"

View File

@ -38,9 +38,8 @@
****************************************************************************/
// SHSTOCKICONINFO is only available since Vista
#if _WIN32_WINNT < 0x0601
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0601
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0A00
#endif
#include "qwindowstheme.h"

View File

@ -37,11 +37,8 @@
**
****************************************************************************/
#if defined(WINVER) && WINVER < 0x0601
# undef WINVER
#endif
#if !defined(WINVER)
# define WINVER 0x0601 // Enable touch functions for MinGW
#ifndef WINVER
# define WINVER 0x0A00 // Enable touch functions for MinGW
#endif
#include "qwindowswindow.h"

View File

@ -45,7 +45,7 @@
#endif
#if defined(Q_OS_WIN) && !defined(_WIN32_WINNT)
#define _WIN32_WINNT 0x500
#define _WIN32_WINNT 0x0A00
#endif
#include "../../../../shared/filesystem.h"

View File

@ -76,7 +76,9 @@ void NativeMutexUnlock(NativeMutexType *mutex)
}
#endif
#elif defined(Q_OS_WIN)
# define _WIN32_WINNT 0x0400
# if !defined(_WIN32_WINNT)
# define _WIN32_WINNT 0x0A00
# endif
# include <windows.h>
typedef CRITICAL_SECTION NativeMutexType;
void NativeMutexInitialize(NativeMutexType *mutex)