diff options
author | Jeffrey Walton <noloader@gmail.com> | 2021-04-21 13:41:35 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2021-04-21 13:41:35 -0400 |
commit | 0629ed043ad8006ae2d88f8eb219e730f2e551aa (patch) | |
tree | a8b93e400f6403864b33ae691022bb816f360896 /config_ver.h | |
parent | b206071aa7cc82d90cc86a82fd21f82450120e96 (diff) | |
download | cryptopp-git-0629ed043ad8006ae2d88f8eb219e730f2e551aa.tar.gz |
Update compiler versions
Diffstat (limited to 'config_ver.h')
-rw-r--r-- | config_ver.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/config_ver.h b/config_ver.h index 524b08fc..178eafea 100644 --- a/config_ver.h +++ b/config_ver.h @@ -58,12 +58,8 @@ # define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#endif
-#if defined(__xlc__) || defined(__xlC__)
-# define CRYPTOPP_XLC_VERSION ((__xlC__ / 256) * 10000 + (__xlC__ % 256) * 100)
-#endif
-
-// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7
-// Also see https://gist.github.com/yamaya/2924292
+// Apple and LLVM Clang versions. Apple Clang version 7.0 roughly equals
+// LLVM Clang version 3.7. Also see https://gist.github.com/yamaya/2924292
#if defined(__clang__) && defined(__apple_build_version__)
# undef CRYPTOPP_GCC_VERSION
# define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
@@ -72,7 +68,22 @@ # define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#endif
+// Clang pretends to be other compilers. The compiler gets into
+// code paths that it cannot compile. Unset Clang to save the grief.
+// Also see http://github.com/weidai11/cryptopp/issues/147.
+
+#if defined(__xlc__) || defined(__xlC__)
+# undef CRYPTOPP_LLVM_CLANG_VERSION
+# define CRYPTOPP_XLC_VERSION ((__xlC__ / 256) * 10000 + (__xlC__ % 256) * 100)
+#endif
+
+#ifdef __INTEL_COMPILER
+# undef CRYPTOPP_LLVM_CLANG_VERSION
+# define CRYPTOPP_INTEL_VERSION (__INTEL_COMPILER)
+#endif
+
#ifdef _MSC_VER
+# undef CRYPTOPP_LLVM_CLANG_VERSION
# define CRYPTOPP_MSC_VERSION (_MSC_VER)
#endif
|