Clean up WINVER, _WIN32_WINNT macros for MinGW.

Define WINVER, _WIN32_WINNT as 0x501 (Windows XP) in qt_windows.h.
Remove definitions of the same/lower versions and unneeded
definitions in other places. Remove definition for Borland compiler.

Task-number: QTBUG-51673
Change-Id: I2a344a7f7cf78b2afbf45dcdf8bf2a19b93f0a07
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
bb10
Friedemann Kleint 2016-03-03 15:17:01 +01:00
parent bc087db590
commit f2bd0d1192
8 changed files with 6 additions and 72 deletions

View File

@ -39,22 +39,14 @@
#pragma qt_sync_stop_processing
#endif
#if defined(Q_CC_BOR)
// Borland's windows.h does not set these correctly, resulting in
// unusable WinSDK standard dialogs
#ifndef WINVER
# define WINVER 0x0501
#endif
#ifndef _WIN32_WINNT
# 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 0x501
#endif
# ifndef WINVER
# define WINVER 0x501
# endif
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0501
# endif
#endif
#ifndef NOMINMAX

View File

@ -31,13 +31,6 @@
**
****************************************************************************/
#if !defined(WINAPI_FAMILY)
# if _WIN32_WINNT < 0x0500
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
# endif // _WIN32_WINNT < 0x500
#endif // !WINAPI_FAMILY
#include "qfilesystemiterator_p.h"
#include "qfilesystemengine_p.h"
#include "qplatformdefs.h"

View File

@ -31,12 +31,6 @@
**
****************************************************************************/
//#define WINVER 0x0500
#if !defined(WINAPI_FAMILY) && (_WIN32_WINNT < 0x0400)
#define _WIN32_WINNT 0x0400
#endif
#include "qthread.h"
#include "qthread_p.h"
#include "qthreadstorage.h"

View File

@ -31,11 +31,6 @@
**
****************************************************************************/
#if _WIN32_WINNT < 0x0500
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
#include "qwindowsintegration.h"
#include "qwindowsfontengine.h"
#include "qwindowsnativeimage.h"

View File

@ -33,15 +33,6 @@
#ifndef QT_NO_DIRECTWRITE
#if WINVER < 0x0600
# undef WINVER
# define WINVER 0x0600
#endif
#if _WIN32_WINNT < 0x0600
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif
#include "qwindowsfontenginedirectwrite.h"
#include "qwindowsfontdatabase.h"
#include "qwindowscontext.h"

View File

@ -47,18 +47,6 @@
#include <QtGui/QWindow>
#include <QtWidgets/QDesktopWidget>
// Note, these tests are duplicates in qwindowsxpstyle_p.h.
#ifdef Q_CC_GNU
# include <w32api.h>
# if (__W32API_MAJOR_VERSION >= 3 || (__W32API_MAJOR_VERSION == 2 && __W32API_MINOR_VERSION >= 5))
# ifdef _WIN32_WINNT
# undef _WIN32_WINNT
# endif
# define _WIN32_WINNT 0x0501
# include <commctrl.h>
# endif
#endif
#include <uxtheme.h>
Q_DECLARE_METATYPE(QMargins)

View File

@ -50,18 +50,6 @@
#include <qmap.h>
#include <qt_windows.h>
// Note, these tests are duplicated in qwizard_win.cpp.
#ifdef Q_CC_GNU
# include <w32api.h>
# if (__W32API_MAJOR_VERSION >= 3 || (__W32API_MAJOR_VERSION == 2 && __W32API_MINOR_VERSION >= 5))
# ifdef _WIN32_WINNT
# undef _WIN32_WINNT
# endif
# define _WIN32_WINNT 0x0501
# include <commctrl.h>
# endif
#endif
#include <uxtheme.h>
#if WINVER >= 0x0600

View File

@ -34,13 +34,6 @@
#include "qsystemtrayicon_p.h"
#ifndef QT_NO_SYSTEMTRAYICON
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600
# undef _WIN32_WINNT
#endif
#if !defined(_WIN32_WINNT)
# define _WIN32_WINNT 0x0600
#endif
#if defined(_WIN32_IE) && _WIN32_IE < 0x0600
# undef _WIN32_IE
#endif