summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-11-04 11:40:30 -0800
committerThiago Macieira <thiago.macieira@intel.com>2014-11-05 07:30:40 +0100
commit729541f7ca1129731a2ec79492d15e7ecb3cad80 (patch)
tree16e1c1bf724edd73370e28b86e0bfca2b13a1e69 /src/corelib/tools
parent85a71381145528d446416d2744734384dbe739b4 (diff)
Store the GCC version number in Q_CC_GNU
The sequence of (__GNUC__ * 100 + __GNUC_MINOR__) was used in quite a few places. Simplify it to make the code more readable. This follows the change done for Clang, which was quite necessary since Apple's version of Clang has different build numbers. Change-Id: I886271a5a5f21ae59485ecf8d140527723345a46 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qsimd.cpp2
-rw-r--r--src/corelib/tools/qsimd_p.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 0b3bbc0ad0..5281723c5d 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -519,7 +519,7 @@ QBasicAtomicInt qt_cpu_features = Q_BASIC_ATOMIC_INITIALIZER(0);
void qDetectCpuFeatures()
{
#if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
-# if (__GNUC__ * 100 + __GNUC_MINOR__) < 403
+# if Q_CC_GNU < 403
// GCC 4.2 (at least the one that comes with Apple's XCode, on Mac) is
// known to be broken beyond repair in dealing with the inline assembly
// above. It will generate bad code that could corrupt important registers
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 3241e09b08..891a3ff053 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -218,7 +218,7 @@
#endif
// other x86 intrinsics
-#if defined(Q_PROCESSOR_X86) && ((defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)) \
+#if defined(Q_PROCESSOR_X86) && ((defined(Q_CC_GNU) && (Q_CC_GNU >= 404)) \
|| (defined(Q_CC_CLANG) && (Q_CC_CLANG >= 208)) \
|| defined(Q_CC_INTEL))
# define QT_COMPILER_SUPPORTS_X86INTRIN
@@ -332,7 +332,7 @@ static __forceinline unsigned long _bit_scan_forward(uint val)
_BitScanForward(&result, val);
return result;
}
-# elif (defined(Q_CC_CLANG) || (defined(Q_CC_GNU) && __GNUC__ * 100 + __GNUC_MINOR__ < 405)) \
+# elif (defined(Q_CC_CLANG) || (defined(Q_CC_GNU) && Q_CC_GNU < 405)) \
&& !defined(Q_CC_INTEL)
// Clang is missing the intrinsic for _bit_scan_reverse
// GCC only added it in version 4.5