diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index ecf39d699f..a747134df3 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -39,11 +39,13 @@ #if defined(QT_BOOTSTRAPPED) # include -// The following two are used for testing only. -// Note that we don't check the compiler support -- you had better -// know what you're doing if you set them -#elif defined(QT_ATOMIC_FORCE_CXX11) +// If C++11 atomics are supported, use them! +#elif defined(Q_COMPILER_ATOMICS) && defined(Q_COMPILER_CONSTEXPR) && !defined(QT_ATOMIC_FORCE_NO_CXX11) # include + +// The following is used for testing only. +// Note that we don't check the compiler support -- you had better +// know what you're doing if you set it #elif defined(QT_ATOMIC_FORCE_GCC) # include @@ -66,8 +68,6 @@ # include // Fallback compiler dependent implementation -#elif defined(Q_COMPILER_ATOMICS) && defined(Q_COMPILER_CONSTEXPR) -# include #elif defined(Q_CC_GNU) # include diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/char/char.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char/char.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/char/char.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/char/char.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/char16_t/char16_t.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char16_t/char16_t.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/char16_t/char16_t.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/char16_t/char16_t.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/char32_t/char32_t.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char32_t/char32_t.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/char32_t/char32_t.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/char32_t/char32_t.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/int/int.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/int/int.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/int/int.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/int/int.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/long/long.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/long/long.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/long/long.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/long/long.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/qlonglong/qlonglong.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qlonglong/qlonglong.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/qlonglong/qlonglong.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/qlonglong/qlonglong.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/qptrdiff/qptrdiff.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qptrdiff/qptrdiff.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/qptrdiff/qptrdiff.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/qptrdiff/qptrdiff.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/quintptr/quintptr.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/quintptr/quintptr.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/quintptr/quintptr.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/quintptr/quintptr.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/qulonglong/qulonglong.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qulonglong/qulonglong.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/qulonglong/qulonglong.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/qulonglong/qulonglong.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/schar/schar.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/schar/schar.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/schar/schar.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/schar/schar.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/short/short.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/short/short.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/short/short.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/short/short.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/uchar/uchar.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uchar/uchar.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/uchar/uchar.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/uchar/uchar.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/uint/uint.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uint/uint.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/uint/uint.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/uint/uint.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/ulong/ulong.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ulong/ulong.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/ulong/ulong.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/ulong/ulong.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/ushort/ushort.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ushort/ushort.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/ushort/ushort.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/ushort/ushort.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/wchar_t/wchar_t.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/wchar_t/wchar_t.pro similarity index 100% rename from tests/auto/corelib/thread/qatomicinteger/cxx11/wchar_t/wchar_t.pro rename to tests/auto/corelib/thread/qatomicinteger/no-cxx11/wchar_t/wchar_t.pro diff --git a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri index d9ebe64d5b..e80e71f238 100644 --- a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri +++ b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri @@ -3,9 +3,9 @@ TYPE = $$basename(_PRO_FILE_PWD_) dn = $$dirname(_PRO_FILE_PWD_) FORCE = $$basename(dn) -equals(FORCE, cxx11) { - suffix = Cxx11_$$TYPE - DEFINES += QT_ATOMIC_FORCE_CXX11 +equals(FORCE, no-cxx11) { + suffix = NoCxx11_$$TYPE + DEFINES += QT_ATOMIC_FORCE_NO_CXX11 } else: equals(FORCE, gcc) { suffix = Gcc_$$TYPE DEFINES += QT_ATOMIC_FORCE_GCC diff --git a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro index 58e5b157bd..9d929e649e 100644 --- a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro +++ b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro @@ -19,22 +19,22 @@ SUBDIRS=\ contains(QT_CONFIG, c++11)|msvc: SUBDIRS +=\ - cxx11/char \ - cxx11/char16_t \ - cxx11/char32_t \ - cxx11/int \ - cxx11/long \ - cxx11/qlonglong \ - cxx11/qptrdiff \ - cxx11/quintptr \ - cxx11/qulonglong \ - cxx11/schar \ - cxx11/short \ - cxx11/uchar \ - cxx11/uint \ - cxx11/ulong \ - cxx11/ushort \ - cxx11/wchar_t \ + no-cxx11/char \ + no-cxx11/char16_t \ + no-cxx11/char32_t \ + no-cxx11/int \ + no-cxx11/long \ + no-cxx11/qlonglong \ + no-cxx11/qptrdiff \ + no-cxx11/quintptr \ + no-cxx11/qulonglong \ + no-cxx11/schar \ + no-cxx11/short \ + no-cxx11/uchar \ + no-cxx11/uint \ + no-cxx11/ulong \ + no-cxx11/ushort \ + no-cxx11/wchar_t \ # The GCC-style atomics only support 32-bit and pointer-sized but add