summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobalstatic.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-06-18 15:41:26 -0700
committerThiago Macieira <thiago.macieira@intel.com>2014-06-27 00:29:13 +0200
commitea6352109b6b73e72b578534fe6d1c90767a22a3 (patch)
tree35eb0c75f5eb43b02ed23b1b2e0645135dfce067 /src/corelib/global/qglobalstatic.h
parenta58ec950f06c8de366b4b693491eaaafae116041 (diff)
Add Q_COMPILER_THREADSAFE_STATICS (a.k.a. "Magic Statics")
It had been so far only supported by GNU-style compilers due to the IA-64 portable C++ ABI. But it's mandated by C++11, so let's add the macro and use it in Q_GLOBAL_STATIC. Looks like Visual Studio "14" will support it. Change-Id: I9710b5146606c7e494c43413f49900419396cfe0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/global/qglobalstatic.h')
-rw-r--r--src/corelib/global/qglobalstatic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index ad39452cf4..e9330a4b9e 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -57,7 +57,7 @@ enum GuardValues {
};
}
-#if defined(QT_NO_THREAD) || (defined(Q_CC_GNU) && !defined(Q_OS_MAC))
+#if defined(QT_NO_THREAD) || defined(Q_COMPILER_THREADSAFE_STATICS)
// some compilers support thread-safe statics
// The IA-64 C++ ABI requires this, so we know that all GCC versions since 3.4
// support it. C++11 also requires this behavior.