From 192df93d7ba8ca9aedd780a73eef3a56f53607a2 Mon Sep 17 00:00:00 2001 From: Daniela Engert Date: Fri, 5 May 2023 19:21:18 +0200 Subject: [PATCH] modules missing pieces (#3399) - 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 87b67948..99179922 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 a956a70e..8ce91af5 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