summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-11-05 18:09:59 -0800
committerThiago Macieira <thiago.macieira@intel.com>2017-11-14 15:54:47 +0000
commit9db46732a8a73cefcf4715582e35844737af465f (patch)
tree1fac505281b5d8d08a4b1975f904d33871de9e0d
parent38271e9298dcf48652a6e2e08414a940a97867fa (diff)
Make qsimd_p.h compile in C mode too
Since we very often need to write our intrinsic-using code in C to avoid "leakage" of not-inlined inline functions, this file is very handy. Change-Id: I57a1bd6e0c194530b732fffd14f45d27a32538f8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rw-r--r--src/corelib/tools/qsimd_p.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 181da4f7de..a462d7bb58 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -53,7 +53,6 @@
//
#include <QtCore/private/qglobal_p.h>
-#include <qatomic.h>
/*
* qt_module_config.prf defines the QT_COMPILER_SUPPORTS_XXX macros.
@@ -333,8 +332,10 @@
# include <arm_acle.h>
#endif
-QT_BEGIN_NAMESPACE
+#ifdef __cplusplus
+#include <qatomic.h>
+QT_BEGIN_NAMESPACE
enum CPUFeatures {
#if defined(Q_PROCESSOR_ARM)
@@ -512,9 +513,11 @@ static inline quint64 qCpuFeatures()
#define ALIGNMENT_PROLOGUE_32BYTES(ptr, i, length) \
for (; i < static_cast<int>(qMin(static_cast<quintptr>(length), ((8 - ((reinterpret_cast<quintptr>(ptr) >> 2) & 0x7)) & 0x7))); ++i)
+QT_END_NAMESPACE
+
+#endif // __cplusplus
+
#define SIMD_EPILOGUE(i, length, max) \
for (int _i = 0; _i < max && i < length; ++i, ++_i)
-QT_END_NAMESPACE
-
#endif // QSIMD_P_H