summaryrefslogtreecommitdiff
path: root/lsh512.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-04-19 06:47:41 -0400
committerJeffrey Walton <noloader@gmail.com>2021-04-19 06:47:41 -0400
commit07da15a8bb1785a3a68ee7e5575d5bc829ae8437 (patch)
tree40b838f9124acfe096fa48df27d61f6ae4678fe8 /lsh512.cpp
parent4f2a7b474989e71d319826dfb92e9a8cf5690fd5 (diff)
downloadcryptopp-git-07da15a8bb1785a3a68ee7e5575d5bc829ae8437.tar.gz
Fix Apple Clang compile
Diffstat (limited to 'lsh512.cpp')
-rw-r--r--lsh512.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/lsh512.cpp b/lsh512.cpp
index e3ca2c01..d1325ced 100644
--- a/lsh512.cpp
+++ b/lsh512.cpp
@@ -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