Update std::format check

This commit is contained in:
Jeremy 2023-09-21 21:21:13 -04:00
parent 08d831df5f
commit a10e27a720
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4

View File

@ -8,9 +8,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#ifdef __cpp_lib_format #if __cplusplus >= 202002L
#ifdef __has_include
#if __has_include(<format>)
#define CPPTRACE_STD_FORMAT
#include <format> #include <format>
#endif #endif
#endif
#endif
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32) || defined(__CYGWIN__)
#define CPPTRACE_API __declspec(dllexport) #define CPPTRACE_API __declspec(dllexport)
@ -249,7 +254,7 @@ namespace cpptrace {
}; };
} }
#ifdef __cpp_lib_format #if defined(CPPTRACE_STD_FORMAT) && defined(__cpp_lib_format)
template <> template <>
struct std::formatter<cpptrace::stacktrace_frame> : std::formatter<std::string> { struct std::formatter<cpptrace::stacktrace_frame> : std::formatter<std::string> {
auto format(cpptrace::stacktrace_frame frame, format_context& ctx) const { auto format(cpptrace::stacktrace_frame frame, format_context& ctx) const {