Fix module fmt::join<string_view> (#4577)

FMT_USE_STRING_VIEW define was incorrectly not being defined when using
modules, so there was no appropriate formatter specialization for
std::string_view
Fixes #4379
This commit is contained in:
Justin Riddell
2025-10-16 19:25:19 +01:00
committed by GitHub
parent 8eebb4334b
commit 31bed1bb65

View File

@@ -40,6 +40,12 @@
#include "base.h" #include "base.h"
// libc++ supports string_view in pre-c++17.
#if FMT_HAS_INCLUDE(<string_view>) && \
(FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
# define FMT_USE_STRING_VIEW
#endif
#ifndef FMT_MODULE #ifndef FMT_MODULE
# include <stdlib.h> // malloc, free # include <stdlib.h> // malloc, free
@@ -62,11 +68,8 @@
# include <bit> // std::bit_cast # include <bit> // std::bit_cast
# endif # endif
// libc++ supports string_view in pre-c++17. # if defined(FMT_USE_STRING_VIEW)
# if FMT_HAS_INCLUDE(<string_view>) && \
(FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
# include <string_view> # include <string_view>
# define FMT_USE_STRING_VIEW
# endif # endif
# if FMT_MSC_VERSION # if FMT_MSC_VERSION