From 97c8b970cdeae405018fdaaee12bf4cea59fb23f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 30 May 2018 15:29:50 +0200 Subject: Revert "Atomics: remove qatomic_msvc.h" This reverts commit 90493e16b8dd9edc6176d0abc255422edbbb05c3. The change broke static builds with MSVC. [ChangeLog][Visual Studio] Reverted a change that caused static binaries compiled with Visual Studio 2015 to crash on start-up. Note that this does not apply to Visual Studio 2017 static binaries, even though the crash stack traces are very similar: with 2017, the problem is compiler regression and requires updating to version 15.8 for the fix. Task-number: QTBUG-68514 Change-Id: I67ea8e1ef442cecab83e7d8d74efc9617e02da35 Reviewed-by: Thiago Macieira --- src/corelib/thread/qbasicatomic.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/corelib/thread/qbasicatomic.h') 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 -#else + +// If C++11 atomics are supported, use them! +// Note that constexpr support is sometimes disabled in QNX builds but its +// library has . +#elif defined(Q_COMPILER_ATOMICS) && (defined(Q_COMPILER_CONSTEXPR) || defined(Q_OS_QNX)) # include + +// We only support one fallback: MSVC, because even on version 2015, it lacks full constexpr support +#elif defined(Q_CC_MSVC) +# include + +// No fallback +#else +# error "Qt requires C++11 support" #endif QT_WARNING_PUSH -- cgit v1.2.3