summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qatomic.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-12-02 19:39:36 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-30 18:06:23 +0100
commitfd0d576709fff48bc23444b3a30a86e92c625101 (patch)
treee3041b952aad7d02f5c23b1201cf8c1a5f767094 /src/corelib/thread/qatomic.cpp
parent8d2a9bcf1d22c3e48ff9dc7d8aaac9d4fcac0c64 (diff)
Centralize support for QBasicAtomic for ints and longs
No need to redefine everywhere, since they're required to be supported. Change-Id: I2bdbbd0b0c44871e3bd0edcf0289fc58dd50ff31 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/thread/qatomic.cpp')
-rw-r--r--src/corelib/thread/qatomic.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp
index 36cdfdb369..bebdab3080 100644
--- a/src/corelib/thread/qatomic.cpp
+++ b/src/corelib/thread/qatomic.cpp
@@ -1221,9 +1221,34 @@
QT_BEGIN_NAMESPACE
-// The following three specializations must always be defined
+// The following specializations must always be defined
Q_STATIC_ASSERT(sizeof(QAtomicInteger<unsigned>));
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<long>));
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<unsigned long>));
Q_STATIC_ASSERT(sizeof(QAtomicInteger<quintptr>));
Q_STATIC_ASSERT(sizeof(QAtomicInteger<qptrdiff>));
+#ifdef Q_COMPILER_UNICODE_STRINGS
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<char32_t>));
+#endif
+
+#ifdef Q_ATOMIC_INT16_IS_SUPPORTED
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<short>));
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<unsigned short>));
+# if WCHAR_MAX < 0x10000
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<wchar_t>));
+# endif
+# ifdef Q_COMPILER_UNICODE_STRINGS
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<char16_t>));
+# endif
+#endif
+
+#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<qint64>));
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<quint64>));
+#endif
+
+#if WCHAR_MAX == INT_MAX
+Q_STATIC_ASSERT(sizeof(QAtomicInteger<wchar_t>));
+#endif
QT_END_NAMESPACE