summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2012-02-14 23:27:32 +1100
committerQt by Nokia <qt-info@nokia.com>2012-02-15 08:59:29 +0100
commit9c23257fe4ea4778433909e28a5af9895fdb7e24 (patch)
tree0c69cb4e2333b7a2c78e8f1e4101481fddd3ce5f /src/testlib/qtestcase.cpp
parent3296b7327bd84f420df7e5561d192c0a8d0bb409 (diff)
Fix compilation with MinGW
Some headers and constants are available in MinGW-w64 that are not available in the official MinGW. STATE_SYSTEM_HASPOPUP and STATE_SYSTEM_PROTECTED constants are defined if they are not already defined by including oleacc.h. _CrtSetReportMode is not used and crtdbg.h is not included when using official MinGW as crtdbg.h is missing from official MinGW. Change-Id: Ie7f3f3726a1663d0fdeb6ee17b86873ae3f61860 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 76bea243b1..549d16b997 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -70,7 +70,9 @@
#ifdef Q_OS_WIN
#ifndef Q_OS_WINCE
-# include <crtdbg.h>
+# if !defined(Q_CC_MINGW) || (defined(Q_CC_MINGW) && defined(__MINGW64_VERSION_MAJOR))
+# include <crtdbg.h>
+# endif
#endif
#include <windows.h> // for Sleep
#endif
@@ -1947,7 +1949,9 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+# if !defined(Q_CC_MINGW) || (defined(Q_CC_MINGW) && defined(__MINGW64_VERSION_MAJOR))
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);
+# endif
SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
#endif