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>
This commit is contained in:
Jonathan Liu 2012-02-14 23:27:32 +11:00 committed by Qt by Nokia
parent 3296b7327b
commit 9c23257fe4
3 changed files with 10 additions and 1 deletions

View File

@ -68,6 +68,9 @@
#if !defined(__MINGW64_VERSION_MAJOR)
#define STATE_SYSTEM_HASPOPUP 0x40000000
#define STATE_SYSTEM_PROTECTED 0x20000000
typedef struct tagUPDATELAYEREDWINDOWINFO {
DWORD cbSize;
HDC hdcDst;

View File

@ -84,6 +84,8 @@
#include "qguifunctions_wince.h"
#endif
#include "qtwindows_additional.h"
QT_BEGIN_NAMESPACE
//#define DEBUG_SHOW_ATCLIENT_COMMANDS

View File

@ -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