-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from kkraus14/fix_constexpr_nvcc
Add patch to fix nvcc
- Loading branch information
Showing
11 changed files
with
197 additions
and
70 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
recipe/patches/0001-Match-SPDLOG_CONSTEXPR_FUNC-to-FMT_CONSTEXPR-2901.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
From a3a499b19dfba55ae9a995de181eac7921c13bf3 Mon Sep 17 00:00:00 2001 | ||
From: Keith Kraus <[email protected]> | ||
Date: Fri, 13 Oct 2023 03:00:00 -0400 | ||
Subject: [PATCH] Match SPDLOG_CONSTEXPR_FUNC to FMT_CONSTEXPR (#2901) | ||
|
||
* Modify the condition of SPDLOG_CONSTEXPR_FUNC to match that of fmt | ||
--- | ||
include/spdlog/common.h | 29 +++++++++++++++++++---------- | ||
1 file changed, 19 insertions(+), 10 deletions(-) | ||
|
||
diff --git a/include/spdlog/common.h b/include/spdlog/common.h | ||
index 0a262eb2..29ef2324 100644 | ||
--- a/include/spdlog/common.h | ||
+++ b/include/spdlog/common.h | ||
@@ -62,17 +62,26 @@ | ||
|
||
// visual studio up to 2013 does not support noexcept nor constexpr | ||
#if defined(_MSC_VER) && (_MSC_VER < 1900) | ||
-# define SPDLOG_NOEXCEPT _NOEXCEPT | ||
-# define SPDLOG_CONSTEXPR | ||
-# define SPDLOG_CONSTEXPR_FUNC inline | ||
+ #define SPDLOG_NOEXCEPT _NOEXCEPT | ||
+ #define SPDLOG_CONSTEXPR | ||
#else | ||
-# define SPDLOG_NOEXCEPT noexcept | ||
-# define SPDLOG_CONSTEXPR constexpr | ||
-# if __cplusplus >= 201402L | ||
-# define SPDLOG_CONSTEXPR_FUNC constexpr | ||
-# else | ||
-# define SPDLOG_CONSTEXPR_FUNC inline | ||
-# endif | ||
+ #define SPDLOG_NOEXCEPT noexcept | ||
+ #define SPDLOG_CONSTEXPR constexpr | ||
+#endif | ||
+ | ||
+// If building with std::format, can just use constexpr, otherwise if building with fmt | ||
+// SPDLOG_CONSTEXPR_FUNC needs to be set the same as FMT_CONSTEXPR to avoid situations where | ||
+// a constexpr function in spdlog could end up calling a non-constexpr function in fmt | ||
+// depending on the compiler | ||
+// If fmt determines it can't use constexpr, we should inline the function instead | ||
+#ifdef SPDLOG_USE_STD_FORMAT | ||
+ #define SPDLOG_CONSTEXPR_FUNC constexpr | ||
+#else // Being built with fmt | ||
+ #if FMT_USE_CONSTEXPR | ||
+ #define SPDLOG_CONSTEXPR_FUNC FMT_CONSTEXPR | ||
+ #else | ||
+ #define SPDLOG_CONSTEXPR_FUNC inline | ||
+ #endif | ||
#endif | ||
|
||
#if defined(__GNUC__) || defined(__clang__) | ||
-- | ||
2.42.0 | ||
|
File renamed without changes.