diff --git a/include/fmt/format.h b/include/fmt/format.h index 5333eb51..0cd3a232 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -40,6 +40,12 @@ #include "base.h" +// libc++ supports string_view in pre-c++17. +#if FMT_HAS_INCLUDE() && \ + (FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION)) +# define FMT_USE_STRING_VIEW +#endif + #ifndef FMT_MODULE # include // malloc, free @@ -62,11 +68,8 @@ # include // std::bit_cast # endif -// libc++ supports string_view in pre-c++17. -# if FMT_HAS_INCLUDE() && \ - (FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION)) +# if defined(FMT_USE_STRING_VIEW) # include -# define FMT_USE_STRING_VIEW # endif # if FMT_MSC_VERSION