diff options
Diffstat (limited to 'src/corelib/thread/qbasicatomic.h')
| -rw-r--r-- | src/corelib/thread/qbasicatomic.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index aacd12f2208..a0304697b88 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -45,8 +45,20 @@ #if defined(QT_BOOTSTRAPPED) # include <QtCore/qatomic_bootstrap.h> -#else + +// If C++11 atomics are supported, use them! +// Note that constexpr support is sometimes disabled in QNX builds but its +// library has <atomic>. +#elif defined(Q_COMPILER_ATOMICS) && (defined(Q_COMPILER_CONSTEXPR) || defined(Q_OS_QNX)) # include <QtCore/qatomic_cxx11.h> + +// We only support one fallback: MSVC, because even on version 2015, it lacks full constexpr support +#elif defined(Q_CC_MSVC) +# include <QtCore/qatomic_msvc.h> + +// No fallback +#else +# error "Qt requires C++11 support" #endif QT_WARNING_PUSH |
