summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qnumeric.h
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2021-01-25 18:53:36 +0100
committerRobert Löhning <robert.loehning@qt.io>2021-02-01 13:47:13 +0000
commitc08ebbeca9f9e141287b4942b265a19cddef3253 (patch)
tree93a716f3c6062454a00b3112f06347ae33bdc7b3 /src/corelib/global/qnumeric.h
parentf1cebefd01e8162846e072daa69e48bebd6bbeec (diff)
Fix compilation with 32-bit clang
Currently fails with: undefined reference to `__mulodi4' Change-Id: Iefa321d6fd7cb989dd4a00166ed65e5b7f3ba33f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qnumeric.h')
-rw-r--r--src/corelib/global/qnumeric.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/global/qnumeric.h b/src/corelib/global/qnumeric.h
index 63ba2bb378..49d795902c 100644
--- a/src/corelib/global/qnumeric.h
+++ b/src/corelib/global/qnumeric.h
@@ -114,9 +114,12 @@ Q_CORE_EXPORT quint64 qFloatDistance(double a, double b);
// size_t. Implementations for 8- and 16-bit types will work but may not be as
// efficient. Implementations for 64-bit may be missing on 32-bit platforms.
-#if ((defined(Q_CC_INTEL) ? (Q_CC_INTEL >= 1800 && !defined(Q_OS_WIN)) : defined(Q_CC_GNU)) \
- && Q_CC_GNU >= 500) || __has_builtin(__builtin_add_overflow)
+#if (((defined(Q_CC_INTEL) ? (Q_CC_INTEL >= 1800 && !defined(Q_OS_WIN)) : defined(Q_CC_GNU)) \
+ && Q_CC_GNU >= 500) \
+ || __has_builtin(__builtin_add_overflow)) \
+ && !(QT_POINTER_SIZE == 4 && defined(Q_CC_CLANG))
// GCC 5, ICC 18, and Clang 3.8 have builtins to detect overflows
+// 32 bit Clang has the builtins but tries to link a library which hasn't
#define Q_INTRINSIC_MUL_OVERFLOW64
template <typename T> inline