From b5142e044ff1befc396686a6968e977234896c08 Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sun, 23 Dec 2018 13:49:39 +0000 Subject: [PATCH] Use SSE2 intrinsics header in sse_simd.cpp only if needed (#759) Embarcadero C++Builder v10.3 [has a bug](https://quality.embarcadero.com/browse/RSP-22883) where its old Intel intrinsics headers try to use retired Clang builtins and fail to compile. In devising a workaround with `-DCRYPTOPP_DISABLE_ASM`, I found that `sse_simd.cpp` includes `` even when its code doesn't need the intrinsics. With this patch, `-DCRYPTOPP_DISABLE_ASM` will be a sufficient workaround because `CRYPTOPP_SSE2_INTRIN_AVAILABLE` is derived from it in `config.h`. --- sse_simd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sse_simd.cpp b/sse_simd.cpp index 09484fa0..bd4d59c2 100644 --- a/sse_simd.cpp +++ b/sse_simd.cpp @@ -24,7 +24,9 @@ // Needed by SunCC and MSVC #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) -# include +# if !defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) && !CRYPTOPP_SSE2_ASM_AVAILABLE && CRYPTOPP_SSE2_INTRIN_AVAILABLE +# include +# endif #endif // Squash MS LNK4221 and libtool warnings