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>bb10
parent
d4d752e241
commit
0fa0608f70
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue