From: Jonathan Liu Date: Tue, 14 Feb 2012 12:27:32 +0000 (+1100) Subject: Fix compilation with MinGW X-Git-Tag: qt-v5.0.0-alpha1~1079 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c23257fe4ea4778433909e28a5af9895fdb7e24;p=profile%2Fivi%2Fqtbase.git 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 Reviewed-by: Friedemann Kleint --- diff --git a/src/plugins/platforms/windows/qtwindows_additional.h b/src/plugins/platforms/windows/qtwindows_additional.h index a85a798..ab51f36 100644 --- a/src/plugins/platforms/windows/qtwindows_additional.h +++ b/src/plugins/platforms/windows/qtwindows_additional.h @@ -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; diff --git a/src/plugins/platforms/windows/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/qwindowsaccessibility.cpp index e36e255..3ef21fa 100644 --- a/src/plugins/platforms/windows/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/qwindowsaccessibility.cpp @@ -84,6 +84,8 @@ #include "qguifunctions_wince.h" #endif +#include "qtwindows_additional.h" + QT_BEGIN_NAMESPACE //#define DEBUG_SHOW_ATCLIENT_COMMANDS diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 76bea24..549d16b 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -70,7 +70,9 @@ #ifdef Q_OS_WIN #ifndef Q_OS_WINCE -# include +# if !defined(Q_CC_MINGW) || (defined(Q_CC_MINGW) && defined(__MINGW64_VERSION_MAJOR)) +# include +# endif #endif #include // 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