summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qcompilerdetection.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qcompilerdetection.h')
-rw-r--r--src/corelib/global/qcompilerdetection.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index ebffe74188..64c96023b0 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -48,6 +48,7 @@
/*
The compiler, must be one of: (Q_CC_x)
+ COVERITY - Coverity cov-scan
SYM - Digital Mars C/C++ (used to be Symantec C++)
MSVC - Microsoft Visual C/C++, Intel C++ for Windows
BOR - Borland/Turbo C++
@@ -74,6 +75,10 @@
Should be sorted most to least authoritative.
*/
+#if defined(__COVERITY__)
+# define Q_CC_COVERITY
+#endif
+
/* Symantec C++ is now Digital Mars */
#if defined(__DMC__) || defined(__SC__)
# define Q_CC_SYM
@@ -83,11 +88,14 @@
# endif
#elif defined(_MSC_VER)
+# define Q_CC_MSVC (_MSC_VER)
+# define Q_CC_MSVC_NET
+# define Q_CC_MSVC_ONLY Q_CC_MSVC
# ifdef __clang__
+# undef Q_CC_MSVC_ONLY
# define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
+# define Q_CC_CLANG_ONLY Q_CC_CLANG
# endif
-# define Q_CC_MSVC (_MSC_VER)
-# define Q_CC_MSVC_NET
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_COMPILER_MANGLES_RETURN_TYPE
# define Q_FUNC_INFO __FUNCSIG__
@@ -106,6 +114,10 @@
# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N)) // Since _MSC_VER >= 1500
/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */
# if defined(__INTEL_COMPILER)
+# undef Q_CC_MSVC_ONLY
+# ifdef Q_CC_CLANG_ONLY
+# undef Q_CC_CLANG_ONLY
+# endif
# define Q_DECL_VARIABLE_DEPRECATED
# define Q_CC_INTEL __INTEL_COMPILER
# endif
@@ -183,6 +195,7 @@
# else
# define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
# endif
+# define Q_CC_CLANG_ONLY Q_CC_CLANG
# if __has_builtin(__builtin_assume)
# define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
# else
@@ -205,6 +218,7 @@
# endif
# else
/* Plain GCC */
+# define Q_CC_GNU_ONLY Q_CC_GNU
# if Q_CC_GNU >= 405
# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
@@ -836,7 +850,7 @@
# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
#endif
-#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
+#if defined(Q_CC_GNU_ONLY)
# define Q_COMPILER_RESTRICTED_VLA
# define Q_COMPILER_THREADSAFE_STATICS
# if Q_CC_GNU >= 403
@@ -1247,6 +1261,16 @@
#endif
/*
+ * "Weak overloads" - makes an otherwise confliciting overload weaker
+ * (by making it a template)
+ */
+#ifndef Q_CLANG_QDOC
+# define Q_WEAK_OVERLOAD template <typename = void>
+#else
+# define Q_WEAK_OVERLOAD
+#endif
+
+/*
* Warning/diagnostic handling
*/
@@ -1371,6 +1395,7 @@
# undef QT_COMPILER_SUPPORTS_SSE4_2
# undef QT_COMPILER_SUPPORTS_AVX
# undef QT_COMPILER_SUPPORTS_AVX2
+# undef QT_COMPILER_SUPPORTS_F16C
#endif
#if !defined(Q_PROCESSOR_ARM)
# undef QT_COMPILER_SUPPORTS_NEON