summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2014-08-28 15:22:35 +0200
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-09-15 15:58:40 +0200
commit0fa0608f707306cb34a9ca91952cebbac25065a5 (patch)
treeac710d8cea0bbfe2363be743595af8a6f782e0d3 /src
parentd4d752e241684a9639129e4fb5863883610f5137 (diff)
Logging: Remove use of _declspec(thread)
thread-local variables are known to be broken on Windows XP if the library is loaded dynamically. This has been fixed since Windows Vista, but to avoid any elaborate runtime checking of the OS version we're just removing the logic alltogether for MSVC / Windows. Task-number: QTBUG-41008 Change-Id: I64ee95270d142294c975a5890d6e1b62a833b6ef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qlogging.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index ca0fb1bb23..51169eb963 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1282,12 +1282,9 @@ static void qDefaultMsgHandler(QtMsgType type, const char *buf)
qDefaultMessageHandler(type, emptyContext, QString::fromLocal8Bit(buf));
}
-#if defined(Q_COMPILER_THREAD_LOCAL) || (defined(Q_CC_MSVC) && !defined(Q_OS_WINCE))
-#if defined(Q_CC_MSVC)
-static __declspec(thread) bool msgHandlerGrabbed = false;
-#else
+#if defined(Q_COMPILER_THREAD_LOCAL)
+
static thread_local bool msgHandlerGrabbed = false;
-#endif
static bool grabMessageHandler()
{
@@ -1306,7 +1303,7 @@ static void ungrabMessageHandler()
#else
static bool grabMessageHandler() { return true; }
static void ungrabMessageHandler() { }
-#endif // (Q_COMPILER_THREAD_LOCAL) || ((Q_CC_MSVC) && !(Q_OS_WINCE))
+#endif // (Q_COMPILER_THREAD_LOCAL)
static void qt_message_print(QtMsgType msgType, const QMessageLogContext &context, const QString &message)
{