diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-02-01 10:19:07 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-01 11:06:19 +0100 |
commit | b44e67e1ca5766daef3e4f7a6dd433ebe0f744d1 (patch) | |
tree | fd10ab1e36f4b0c2c6b8d2061ae3dc71c508ba7b /src/corelib/io | |
parent | 9fa4e51dbb8cac4f7f5a6bee6e1b9b029b57f393 (diff) |
Windows: Fix inclusion of <windows.h>
- Always use <qt_windows.h> as the last file to be included.
- Remove it from some headers, use Qt::HANDLE instead of HANDLE.
- Clean up #ifdef, use Q_OS_WIN for Windows/Windows CE.
- Add NOMINMAX to qt_windows.h to avoid problems with the
min/max macros.
- Remove <windows.h> from qplatformdefs.h (VS2005)
Change-Id: Ic44e2cb3eafce38e1ad645c3bf85745439398e50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qfilesystemmetadata_p.h | 9 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_win.cpp | 7 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_win_p.h | 15 | ||||
-rw-r--r-- | src/corelib/io/qprocess.h | 2 | ||||
-rw-r--r-- | src/corelib/io/qsettings.cpp | 10 | ||||
-rw-r--r-- | src/corelib/io/qsettings_p.h | 4 | ||||
-rw-r--r-- | src/corelib/io/qsettings_win.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qtemporarydir.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qwindowspipereader_p.h | 4 |
9 files changed, 26 insertions, 29 deletions
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h index ea981f0bbc..792ee0e714 100644 --- a/src/corelib/io/qfilesystemmetadata_p.h +++ b/src/corelib/io/qfilesystemmetadata_p.h @@ -59,10 +59,11 @@ #include <QtCore/qabstractfileengine.h> // Platform-specific includes -#if defined(Q_OS_WIN) -#ifndef IO_REPARSE_TAG_SYMLINK -#define IO_REPARSE_TAG_SYMLINK (0xA000000CL) -#endif +#ifdef Q_OS_WIN +# include <QtCore/qt_windows.h> +# ifndef IO_REPARSE_TAG_SYMLINK +# define IO_REPARSE_TAG_SYMLINK (0xA000000CL) +# endif #endif QT_BEGIN_NAMESPACE diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp index 8b84457e67..715e16bc7e 100644 --- a/src/corelib/io/qfilesystemwatcher_win.cpp +++ b/src/corelib/io/qfilesystemwatcher_win.cpp @@ -52,8 +52,15 @@ #include <qdir.h> #include <qtextstream.h> +#include <qt_windows.h> + QT_BEGIN_NAMESPACE +QWindowsFileSystemWatcherEngine::Handle::Handle() + : handle(INVALID_HANDLE_VALUE), flags(0u) +{ +} + QWindowsFileSystemWatcherEngine::~QWindowsFileSystemWatcherEngine() { foreach(QWindowsFileSystemWatcherEngineThread *thread, threads) { diff --git a/src/corelib/io/qfilesystemwatcher_win_p.h b/src/corelib/io/qfilesystemwatcher_win_p.h index 84b1dcc693..8daf5a94ad 100644 --- a/src/corelib/io/qfilesystemwatcher_win_p.h +++ b/src/corelib/io/qfilesystemwatcher_win_p.h @@ -57,8 +57,6 @@ #ifndef QT_NO_FILESYSTEMWATCHER -#include <qt_windows.h> - #include <QtCore/qdatetime.h> #include <QtCore/qthread.h> #include <QtCore/qfile.h> @@ -90,15 +88,10 @@ public: class Handle { public: - HANDLE handle; + Qt::HANDLE handle; uint flags; - Handle() - : handle(INVALID_HANDLE_VALUE), flags(0u) - { } - Handle(const Handle &other) - : handle(other.handle), flags(other.flags) - { } + Handle(); }; class PathInfo { @@ -147,12 +140,12 @@ public: void wakeup(); QMutex mutex; - QVector<HANDLE> handles; + QVector<Qt::HANDLE> handles; int msg; QHash<QString, QWindowsFileSystemWatcherEngine::Handle> handleForDir; - QHash<HANDLE, QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo> > pathInfoForHandle; + QHash<Qt::HANDLE, QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo> > pathInfoForHandle; Q_SIGNALS: void fileChanged(const QString &path, bool removed); diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h index f5203fb2ff..1890635eda 100644 --- a/src/corelib/io/qprocess.h +++ b/src/corelib/io/qprocess.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_PROCESS -#if (!defined(Q_OS_WIN32) && !defined(Q_OS_WINCE)) || defined(qdoc) +#if !defined(Q_OS_WIN) || defined(qdoc) typedef qint64 Q_PID; #else QT_END_NAMESPACE diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index e9ef01333d..3d2ac329ca 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -68,17 +68,17 @@ #include "qcoreapplication.h" #endif -#ifdef Q_OS_WIN // for homedirpath reading from registry -#include "qt_windows.h" -#include <private/qsystemlibrary_p.h> -#endif - #ifdef Q_OS_VXWORKS # include <ioLib.h> #endif #include <stdlib.h> +#ifdef Q_OS_WIN // for homedirpath reading from registry +# include <private/qsystemlibrary_p.h> +# include <qt_windows.h> +#endif + #ifndef CSIDL_COMMON_APPDATA #define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data #endif diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index e53ca24669..f4f285bae4 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -64,10 +64,6 @@ #endif #include "private/qscopedpointer_p.h" -#ifdef Q_OS_WIN -#include "QtCore/qt_windows.h" -#endif - QT_BEGIN_NAMESPACE #define QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp index f151145297..5ddc1dd1b1 100644 --- a/src/corelib/io/qsettings_win.cpp +++ b/src/corelib/io/qsettings_win.cpp @@ -46,8 +46,8 @@ #include "qsettings_p.h" #include "qvector.h" #include "qmap.h" -#include "qt_windows.h" #include "qdebug.h" +#include <qt_windows.h> QT_BEGIN_NAMESPACE diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index fedbb695e8..53a48609e5 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -53,8 +53,8 @@ #include <stdlib.h> // mkdtemp #ifdef Q_OS_WIN -#include <windows.h> #include <private/qfsfileengine_p.h> +#include <qt_windows.h> #endif QT_BEGIN_NAMESPACE diff --git a/src/corelib/io/qwindowspipereader_p.h b/src/corelib/io/qwindowspipereader_p.h index d9d9cf9717..6bf950eec1 100644 --- a/src/corelib/io/qwindowspipereader_p.h +++ b/src/corelib/io/qwindowspipereader_p.h @@ -56,10 +56,10 @@ #include <qbytearray.h> #include <qobject.h> #include <qtimer.h> -#include <qt_windows.h> - #include <private/qringbuffer_p.h> +#include <qt_windows.h> + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE |