summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-02-01 10:19:07 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-01 11:06:19 +0100
commitb44e67e1ca5766daef3e4f7a6dd433ebe0f744d1 (patch)
treefd10ab1e36f4b0c2c6b8d2061ae3dc71c508ba7b /src/corelib/tools/qstring.cpp
parent9fa4e51dbb8cac4f7f5a6bee6e1b9b029b57f393 (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/tools/qstring.cpp')
-rw-r--r--src/corelib/tools/qstring.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index fd9f934571..c285f7a007 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -64,24 +64,26 @@
#include <private/qfunctions_p.h>
-#if defined(Q_OS_WINCE)
-#include <windows.h>
-#include <winnls.h>
-#endif
-
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
-#ifdef truncate
-#undef truncate
-#endif
-
#include "qchar.cpp"
#include "qstringmatcher.cpp"
+#ifdef Q_OS_WIN
+# include <qt_windows.h>
+# ifdef Q_OS_WINCE
+# include <winnls.h>
+# endif
+#endif
+
+#ifdef truncate
+# undef truncate
+#endif
+
#ifndef LLONG_MAX
#define LLONG_MAX qint64_C(9223372036854775807)
#endif
@@ -4710,12 +4712,6 @@ int QString::localeAwareCompare(const QString &other) const
return localeAwareCompare_helper(constData(), length(), other.constData(), other.length());
}
-#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
-QT_END_NAMESPACE
-#include "qt_windows.h"
-QT_BEGIN_NAMESPACE
-#endif
-
/*!
\internal
\since 4.5