Skip to content

Commit

Permalink
fix compilation of ginkgo 1.7.0 with msvc & C++20
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Dec 6, 2023
1 parent 52dbba8 commit 9d17a69
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
12 changes: 8 additions & 4 deletions recipes/ginkgo/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,25 @@ sources:
sha256: "1b0e907b4046cdf7cef16d1730c12ba812b38f2764f49f74f454239a27f63596"
patches:
"1.7.0":
- patch_file: "patches/libc++-chrono.patch"
- patch_file: "patches/1.7.0-0001-libc++-chrono.patch"
patch_type: "official"
patch_description: "Fix for std::chrono incompatibility with libc++"
patch_source: "https://github.com/ginkgo-project/ginkgo/pull/1463"
- patch_file: "patches/1.7.0-0002-msvc-c++20.patch"
patch_type: "portability"
patch_description: "Fix compilation with Visual Studio and C++20"
patch_source: "https://github.com/ginkgo-project/ginkgo/commit/876d8ffb8a632862899de446c694526a89a79863"
"1.4.0":
- patch_file: "patches/windows-symbols.patch"
- patch_file: "patches/1.4.0-0001-windows-symbols.patch"
patch_type: "official"
patch_description: "Fix for excessive link symbol count with MSVC"
patch_source: "https://github.com/ginkgo-project/ginkgo/pull/868"
"1.3.0":
- patch_file: "patches/cmake-fixes.patch"
- patch_file: "patches/1.3.0-0001-cmake-fixes.patch"
patch_type: "official"
patch_description: "Fixes for CMake issues"
patch_source: "https://github.com/ginkgo-project/ginkgo/pull/713, https://github.com/ginkgo-project/ginkgo/pull/720"
- patch_file: "patches/windows-iterator.patch"
- patch_file: "patches/1.3.0-0002-windows-iterator.patch"
patch_type: "official"
patch_description: "Fixes for MSVC compatibility"
patch_source: "https://github.com/ginkgo-project/ginkgo/pull/665"
14 changes: 14 additions & 0 deletions recipes/ginkgo/all/patches/1.7.0-0002-msvc-c++20.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/include/ginkgo/core/base/std_extensions.hpp b/include/ginkgo/core/base/std_extensions.hpp
index 1064ae464..d9966c058 100644
--- a/include/ginkgo/core/base/std_extensions.hpp
+++ b/include/ginkgo/core/base/std_extensions.hpp
@@ -73,7 +73,8 @@ using void_t = typename detail::make_void<Ts...>::type;
// Disable deprecation warnings when using standard > C++14
inline bool uncaught_exception() noexcept
{
-#if __cplusplus > 201402L
+// MSVC uses _MSVC_LANG as __cplusplus
+#if (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) || __cplusplus > 201402L
return std::uncaught_exceptions() > 0;
#else
return std::uncaught_exception();

0 comments on commit 9d17a69

Please sign in to comment.