From 728333c56b629c7efbd712256815601813cb5668 Mon Sep 17 00:00:00 2001 From: Daniela Engert Date: Thu, 20 Apr 2023 07:26:54 +0200 Subject: [PATCH] modules missing pieces - don't export names from `detail` - put more headers into the global module fragment - support MSYS2 and Clang --- include/fmt/format.h | 2 ++ src/fmt.cc | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 87b679488cc0..99179922a5bd 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1039,10 +1039,12 @@ template struct is_contiguous> : std::true_type { }; +FMT_END_EXPORT namespace detail { FMT_API bool write_console(std::FILE* f, string_view text); FMT_API void print(std::FILE*, string_view); } // namespace detail +FMT_BEGIN_EXPORT // Suppress a misleading warning in older versions of clang. #if FMT_CLANG_VERSION diff --git a/src/fmt.cc b/src/fmt.cc index a956a70e416f..8ce91af5f0be 100644 --- a/src/fmt.cc +++ b/src/fmt.cc @@ -29,12 +29,16 @@ module; #include #include #include +#include #include #include #include #include -#if _MSC_VER +#if __has_include() +# include +#endif +#if defined(_MSC_VER) || defined(__MINGW32__) # include #endif #if defined __APPLE__ || defined(__FreeBSD__) @@ -56,6 +60,12 @@ module; # endif #endif #ifdef _WIN32 +# if defined(__GLIBCXX__) +# include +# include +# elif defined(_LIBCPP_VERSION) +# include <__std_stream> +# endif # define WIN32_LEAN_AND_MEAN # include #endif