diff options
author | Jeffrey Walton <noloader@gmail.com> | 2021-04-19 06:47:41 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2021-04-19 06:47:41 -0400 |
commit | 07da15a8bb1785a3a68ee7e5575d5bc829ae8437 (patch) | |
tree | 40b838f9124acfe096fa48df27d61f6ae4678fe8 /lsh512.cpp | |
parent | 4f2a7b474989e71d319826dfb92e9a8cf5690fd5 (diff) | |
download | cryptopp-git-07da15a8bb1785a3a68ee7e5575d5bc829ae8437.tar.gz |
Fix Apple Clang compile
Diffstat (limited to 'lsh512.cpp')
-rw-r--r-- | lsh512.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -66,12 +66,17 @@ # include <immintrin.h>
#endif
-#if (CRYPTOPP_GCC_VERSION >= 40800) || defined(__clang__)
-# include <x86intrin.h>
-# define GCC_HAVE_TARGET 1
-# define GCC_TARGET_DEFAULT __attribute__ ((target ("default")))
-# define GCC_TARGET_SSSE3 __attribute__ ((target ("ssse3")))
-#else
+// https://stackoverflow.com/q/39958935
+#if defined(__i386__) || defined(__i686__) || defined(__amd64__)
+# if (CRYPTOPP_GCC_VERSION >= 40800) || (CRYPTOPP_LLVM_CLANG_VERSION >= 70000)
+# include <x86intrin.h>
+# define GCC_HAVE_TARGET 1
+# define GCC_TARGET_DEFAULT __attribute__ ((target ("default")))
+# define GCC_TARGET_SSSE3 __attribute__ ((target ("ssse3")))
+# endif
+#endif
+
+#ifndef GCC_TARGET_DEFAULT
# define GCC_TARGET_DEFAULT
#endif
|