diff options
author | Andrew Knight <andrew.knight@digia.com> | 2013-09-13 12:22:45 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 13:53:59 +0200 |
commit | d959c37eaa66298579ca55440aff5fdb8b3126b2 (patch) | |
tree | 6c61938d1046fd2e469f63b49f3e58c4da449f88 /src/corelib/global/qlogging.cpp | |
parent | 7e2b238c507ee2fdea26f2b57512f337de2c5f85 (diff) |
WinRT: Basic global support
Various global changes, primarily preprocessor flow, to support the
WinRT platform.
Change-Id: I3fa9cf91d5fb24019362e88fcf205e31b4f810b5
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Diffstat (limited to 'src/corelib/global/qlogging.cpp')
-rw-r--r-- | src/corelib/global/qlogging.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 117ce240d8..5aaa0716f1 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -88,7 +88,7 @@ static bool isFatal(QtMsgType msgType) // Do we have stderr for QDebug? - Either there is a console or we are running // with redirected stderr. -# ifndef Q_OS_WINCE +# if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) static inline bool hasStdErr() { if (GetConsoleWindow()) @@ -98,11 +98,11 @@ static inline bool hasStdErr() return (info.dwFlags & STARTF_USESTDHANDLES) && info.hStdError && info.hStdError != INVALID_HANDLE_VALUE; } -# endif // !Q_OS_WINCE +# endif // !Q_OS_WINCE && !Q_OS_WINRT bool qWinLogToStderr() { -# ifndef Q_OS_WINCE +# if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) static const bool result = hasStdErr(); return result; # else @@ -168,7 +168,7 @@ static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap) Q_DECL { char emergency_buf[256] = { '\0' }; emergency_buf[sizeof emergency_buf - 1] = '\0'; -#if defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB) && defined(Q_OS_WINCE) \ +#if defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB) && (defined(Q_OS_WINCE) || defined(Q_OS_WINRT)) \ || defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) wchar_t emergency_bufL[sizeof emergency_buf]; #endif @@ -177,7 +177,7 @@ static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap) Q_DECL qvsnprintf(emergency_buf, sizeof emergency_buf - 1, msg, ap); #if defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB) -# ifdef Q_OS_WINCE +# if defined(Q_OS_WINCE) || defined(Q_OS_WINRT) convert_to_wchar_t_elided(emergency_bufL, sizeof emergency_buf, emergency_buf); OutputDebugStringW(emergency_bufL); # else @@ -701,7 +701,7 @@ void QMessagePattern::setPattern(const QString &pattern) else if (inIf) error += QStringLiteral("QT_MESSAGE_PATTERN: missing %{endif}\n"); if (!error.isEmpty()) { -#if defined(Q_OS_WINCE) +#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT) OutputDebugString(reinterpret_cast<const wchar_t*>(error.utf16())); if (0) #elif defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB) |