vcpkg/ports/cryptopp/patch.patch
GPUCode c1f48cbfbe
[cryptopp]: Fix compilation with clang-cl (#26151)
* cryptopp: Fix compilation with clang-cl

* Add clang-cl 12.0+ to supported configurations
* Use MSVC path to detect CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS

* cryptopp: Update port version

* cryptopp: Fix clang-cl SIMD flag detection

* Patch CheckCompileLinkOption to use try_compile on all platforms
* Use GNU path when detecing SSE options with clang-cl
2022-08-05 23:33:42 -07:00

35 lines
1.3 KiB
Diff

diff --git a/config_cxx.h b/config_cxx.h
index 03153ba..6d9187d 100644
--- a/config_cxx.h
+++ b/config_cxx.h
@@ -214,7 +214,7 @@
// Also see https://github.com/weidai11/cryptopp/issues/980. I'm not sure what
// to do when the compiler defines __cpp_lib_uncaught_exceptions but the platform
// does not support std::uncaught_exceptions. What was Apple thinking???
-#if defined(__clang__)
+#if defined(__clang__) && !defined(CRYPTOPP_MSC_VERSION)
# if __EXCEPTIONS && __has_feature(cxx_exceptions)
# if __cpp_lib_uncaught_exceptions >= 201411L
# define CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS 1
diff --git a/config_os.h b/config_os.h
index da27de22..9703f77d 100644
--- a/config_os.h
+++ b/config_os.h
@@ -29,7 +29,7 @@
// https://www.cryptopp.com/wiki/Release_Process#Self_Tests
// The problems with Clang pretending to be other compilers is
// discussed at http://github.com/weidai11/cryptopp/issues/147.
-#if (defined(_MSC_VER) && defined(__clang__) && \
+#if (defined(_MSC_VER) && _MSC_VER < 1930 && defined(__clang__) && \
!(defined( __clang_analyzer__)) && !defined(__INTEL_LLVM_COMPILER))
# error: "Unsupported configuration"
#endif
@@ -126,6 +126,7 @@
#endif
#ifdef CRYPTOPP_WIN32_AVAILABLE
+#include <winapifamily.h>
# if !defined(WINAPI_FAMILY)
# define THREAD_TIMER_AVAILABLE
# elif defined(WINAPI_FAMILY)