diff options
author | Tanzinul Islam <tanzislam@users.noreply.github.com> | 2018-12-23 13:49:39 +0000 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-12-23 08:49:39 -0500 |
commit | b5142e044ff1befc396686a6968e977234896c08 (patch) | |
tree | e7078ccbcf412c4a21bd6f3678b226d4ced0bd02 /sse_simd.cpp | |
parent | fc87f8666af83178954d51e8fde4d3e650540c71 (diff) | |
download | cryptopp-git-b5142e044ff1befc396686a6968e977234896c08.tar.gz |
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 `<emmintrin.h>` 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`.
Diffstat (limited to 'sse_simd.cpp')
-rw-r--r-- | sse_simd.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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 <emmintrin.h>
+# if !defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) && !CRYPTOPP_SSE2_ASM_AVAILABLE && CRYPTOPP_SSE2_INTRIN_AVAILABLE
+# include <emmintrin.h>
+# endif
#endif
// Squash MS LNK4221 and libtool warnings
|