From 9db46732a8a73cefcf4715582e35844737af465f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 5 Nov 2017 18:09:59 -0800 Subject: 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 Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qsimd_p.h | 11 +++++++---- 1 file 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 -#include /* * qt_module_config.prf defines the QT_COMPILER_SUPPORTS_XXX macros. @@ -333,8 +332,10 @@ # include #endif -QT_BEGIN_NAMESPACE +#ifdef __cplusplus +#include +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(qMin(static_cast(length), ((8 - ((reinterpret_cast(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 -- cgit v1.2.3