From d959c37eaa66298579ca55440aff5fdb8b3126b2 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Fri, 13 Sep 2013 12:22:45 +0300 Subject: WinRT: Basic global support Various global changes, primarily preprocessor flow, to support the WinRT platform. Change-Id: I3fa9cf91d5fb24019362e88fcf205e31b4f810b5 Reviewed-by: Andrew Knight --- src/corelib/global/qlogging.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/corelib/global/qlogging.cpp') 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(error.utf16())); if (0) #elif defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB) -- cgit v1.2.3