From 7e85e7ced7079d620ae73f8664a68530992c6af1 Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Wed, 10 Feb 2016 13:05:26 +0100 Subject: Add initial clang-cl support to Qt This adds the functionality to build Qt with clang under Windows against the Microsoft Visual Studio 2015 runtime. In order to replicate this, a Clang 3.8 build with Visual Studio 2015 Update 1 is needed. Adds compiler detection to Qt to distinguish correctly the clang compiler and Windows with Visual Studio. Clang has some built-in numeric functions, there is no need to use the Microsoft versions, which also conflict here. Task-number: QTBUG-50804 Change-Id: Ia4b267a298310ac7d73edf473b12792991249d8a Reviewed-by: Oswald Buddenhagen Reviewed-by: Friedemann Kleint --- src/corelib/global/qnumeric_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/global/qnumeric_p.h') diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h index f58e062dbd..5705bc29c8 100644 --- a/src/corelib/global/qnumeric_p.h +++ b/src/corelib/global/qnumeric_p.h @@ -222,7 +222,7 @@ template <> inline bool mul_overflow(unsigned long long v1, unsigned long long v # define HAVE_MUL64_OVERFLOW #endif -#if ((defined(Q_CC_MSVC) && _MSC_VER >= 1800) || defined(Q_CC_INTEL)) && defined(Q_PROCESSOR_X86) +#if ((defined(Q_CC_MSVC) && _MSC_VER >= 1800) || defined(Q_CC_INTEL)) && defined(Q_PROCESSOR_X86) && !QT_HAS_BUILTIN(__builtin_uadd_overflow) template <> inline bool add_overflow(unsigned v1, unsigned v2, unsigned *r) { return _addcarry_u32(0, v1, v2, r); } # ifdef Q_CC_MSVC // longs are 32-bit @@ -230,7 +230,7 @@ template <> inline bool add_overflow(unsigned long v1, unsigned long v2, unsigne { return _addcarry_u32(0, v1, v2, reinterpret_cast(r)); } # endif #endif -#if ((defined(Q_CC_MSVC) && _MSC_VER >= 1800) || defined(Q_CC_INTEL)) && defined(Q_PROCESSOR_X86_64) +#if ((defined(Q_CC_MSVC) && _MSC_VER >= 1800) || defined(Q_CC_INTEL)) && defined(Q_PROCESSOR_X86_64) && !QT_HAS_BUILTIN(__builtin_uadd_overflow) template <> inline bool add_overflow(quint64 v1, quint64 v2, quint64 *r) { return _addcarry_u64(0, v1, v2, reinterpret_cast(r)); } # ifndef Q_CC_MSVC // longs are 64-bit @@ -239,7 +239,7 @@ template <> inline bool add_overflow(unsigned long v1, unsigned long v2, unsigne # endif #endif -#if defined(Q_CC_MSVC) && (defined(Q_PROCESSOR_X86_64) || defined(Q_PROCESSOR_IA64)) +#if defined(Q_CC_MSVC) && (defined(Q_PROCESSOR_X86_64) || defined(Q_PROCESSOR_IA64)) && !QT_HAS_BUILTIN(__builtin_uadd_overflow) #pragma intrinsic(_umul128) template <> inline bool mul_overflow(quint64 v1, quint64 v2, quint64 *r) { -- cgit v1.2.3