QtBase: replace windows.h with qt_windows.h

We have some special handling in qt_windows.h,
use it instead of the original windows.h

Change-Id: I12fa45b09d3f2aad355573dce45861d7d28e1d77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Yuhang Zhao 2021-11-19 13:05:38 +08:00
parent 4c7759cae2
commit e01c25e859
26 changed files with 26 additions and 28 deletions

View File

@ -76,7 +76,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>
//#include <windows.h> //#include <qt_windows.h>
#include <netinet/in.h> #include <netinet/in.h>
#define QT_NO_USE_FSEEKO #define QT_NO_USE_FSEEKO

View File

@ -33,7 +33,7 @@
#include <qregularexpression.h> #include <qregularexpression.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# include <windows.h> # include <qt_windows.h>
#else #else
# include <sys/types.h> # include <sys/types.h>
# include <sys/stat.h> # include <sys/stat.h>

View File

@ -66,7 +66,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#else #else
#include <windows.h> #include <qt_windows.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -57,7 +57,7 @@
# include <sys/sysctl.h> # include <sys/sysctl.h>
# endif # endif
#else #else
#include <windows.h> #include <qt_windows.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -51,7 +51,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#else #else
#include <windows.h> #include <qt_windows.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -48,7 +48,7 @@
** **
****************************************************************************/ ****************************************************************************/
#include <windows.h> #include <qt_windows.h>
#include <shellapi.h> #include <shellapi.h>
/* /*

View File

@ -129,7 +129,7 @@ static void writePrologue(QTextStream &stream, const QString &fileName, const Pr
stream << "#ifndef " << guard << "\n" stream << "#ifndef " << guard << "\n"
<< "#define " << guard << "\n" << "#define " << guard << "\n"
<< "\n" << "\n"
<< "#include <windows.h>\n" << "#include <qt_windows.h>\n"
<< "#include <TraceLoggingProvider.h>\n" << "#include <TraceLoggingProvider.h>\n"
<< "\n"; << "\n";

View File

@ -38,7 +38,7 @@
#include <QTimer> #include <QTimer>
#include <QTemporaryFile> #include <QTemporaryFile>
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
#include <windows.h> #include <qt_windows.h>
#endif #endif
#ifdef Q_OS_ANDROID #ifdef Q_OS_ANDROID

View File

@ -40,7 +40,7 @@
#endif #endif
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
# include <windows.h> # include <qt_windows.h>
#endif #endif
#ifdef Q_OS_INTEGRITY #ifdef Q_OS_INTEGRITY

View File

@ -38,7 +38,7 @@
#include <QtTest/private/qtesthelpers_p.h> #include <QtTest/private/qtesthelpers_p.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# include <shlwapi.h> # include <shlwapi.h>
# include <windows.h> # include <qt_windows.h>
#endif #endif
#ifdef Q_OS_UNIX // for geteuid() #ifdef Q_OS_UNIX // for geteuid()
# include <sys/types.h> # include <sys/types.h>

View File

@ -41,7 +41,7 @@
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
# include <shlwapi.h> # include <shlwapi.h>
# include <windows.h> # include <qt_windows.h>
#endif #endif
#if defined(Q_OS_UNIX) #if defined(Q_OS_UNIX)
# include <sys/types.h> # include <sys/types.h>

View File

@ -46,7 +46,7 @@
#include <pthread.h> #include <pthread.h>
#endif #endif
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
#include <windows.h> #include <qt_windows.h>
#if defined(Q_OS_WIN32) #if defined(Q_OS_WIN32)
#include <process.h> #include <process.h>
#endif #endif

View File

@ -362,7 +362,7 @@ namespace QTest {
"}\n" "}\n"
"\n" "\n"
"#ifdef Q_OS_WIN\n" "#ifdef Q_OS_WIN\n"
"#include <windows.h>\n" "#include <qt_windows.h>\n"
"#if defined(Q_CC_MSVC)\n" "#if defined(Q_CC_MSVC)\n"
"#include <crtdbg.h>\n" "#include <crtdbg.h>\n"
"#endif\n" "#endif\n"

View File

@ -46,7 +46,7 @@
#include <private/qdrawhelper_p.h> #include <private/qdrawhelper_p.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <qt_windows.h>
#endif #endif

View File

@ -52,7 +52,7 @@
#include <time.h> #include <time.h>
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
#include <windows.h> #include <qt_windows.h>
#else #else
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>

View File

@ -45,7 +45,7 @@
#include <math.h> #include <math.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <qt_windows.h>
#endif #endif
#if QT_CONFIG(printer) #if QT_CONFIG(printer)

View File

@ -31,7 +31,7 @@
#include <QTest> #include <QTest>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <qt_windows.h>
#endif #endif
class tst_Crashes: public QObject class tst_Crashes: public QObject

View File

@ -74,7 +74,7 @@ Q_DECLARE_METATYPE(QSizeF)
Q_DECLARE_METATYPE(QTransform) Q_DECLARE_METATYPE(QTransform)
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
#include <windows.h> #include <qt_windows.h>
#define Q_CHECK_PAINTEVENTS \ #define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \ if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
QSKIP("The Graphics View doesn't get the paint events"); QSKIP("The Graphics View doesn't get the paint events");

View File

@ -63,7 +63,7 @@
Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint) Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint)
#if defined (Q_OS_WIN) #if defined (Q_OS_WIN)
#include <windows.h> #include <qt_windows.h>
#define Q_CHECK_PAINTEVENTS \ #define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \ if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
QSKIP("The widgets don't get the paint events"); QSKIP("The widgets don't get the paint events");

View File

@ -47,7 +47,7 @@
using namespace QTestPrivate; using namespace QTestPrivate;
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
# include <windows.h> # include <qt_windows.h>
# include <QDialog> # include <QDialog>
# include <QGuiApplication> # include <QGuiApplication>
# include <QVBoxLayout> # include <QVBoxLayout>

View File

@ -73,9 +73,7 @@
#include <private/qdatetimeedit_p.h> #include <private/qdatetimeedit_p.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# include <windows.h> # include <qt_windows.h>
# undef min
# undef max
#endif #endif

View File

@ -30,7 +30,7 @@
#include <QDirIterator> #include <QDirIterator>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# include <windows.h> # include <qt_windows.h>
#else #else
# include <sys/stat.h> # include <sys/stat.h>
# include <sys/types.h> # include <sys/types.h>

View File

@ -85,7 +85,7 @@
#include <qplatformdefs.h> #include <qplatformdefs.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# include <windows.h> # include <qt_windows.h>
#else #else
# include <sys/stat.h> # include <sys/stat.h>
# include <sys/types.h> # include <sys/types.h>

View File

@ -38,7 +38,7 @@
#include <stdio.h> #include <stdio.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# include <windows.h> # include <qt_windows.h>
#endif #endif
#if defined(Q_OS_QNX) && defined(open) #if defined(Q_OS_QNX) && defined(open)

View File

@ -79,7 +79,7 @@ void NativeMutexUnlock(NativeMutexType *mutex)
# if !defined(_WIN32_WINNT) # if !defined(_WIN32_WINNT)
# define _WIN32_WINNT 0x0A00 # define _WIN32_WINNT 0x0A00
# endif # endif
# include <windows.h> # include <qt_windows.h>
typedef CRITICAL_SECTION NativeMutexType; typedef CRITICAL_SECTION NativeMutexType;
void NativeMutexInitialize(NativeMutexType *mutex) void NativeMutexInitialize(NativeMutexType *mutex)
{ {

View File

@ -38,7 +38,7 @@
#include <QTemporaryDir> #include <QTemporaryDir>
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
#include <windows.h> #include <qt_windows.h>
#include <winioctl.h> #include <winioctl.h>
#ifndef IO_REPARSE_TAG_MOUNT_POINT #ifndef IO_REPARSE_TAG_MOUNT_POINT
#define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L) #define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L)