From a992b3d1fce53e278db61d038a11b2959e1cab73 Mon Sep 17 00:00:00 2001 From: Mathew Benson Date: Sun, 20 Aug 2023 17:32:36 +0300 Subject: [PATCH] Fix for Compilation Error When Using FMT_MODULE (#3597) * FMT_EXPORT reorganization to fix compile error - When compiling with FMT_MODULE, an error was being generated due to use of FMT_EXPORT on a declaration within FMT_BEGIN_EXPORT and FMT_END_EXPORT on `include/core.h` - On `include/format.h` had to exclude the function vformat_to by ending the export block just before it and beginning a new one after it. --- include/fmt/core.h | 1 - include/fmt/format.h | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 39d61831..1fe13888 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1661,7 +1661,6 @@ template class basic_format_arg { \endrst */ // DEPRECATED! -FMT_EXPORT template FMT_CONSTEXPR FMT_INLINE auto visit_format_arg( Visitor&& vis, const basic_format_arg& arg) -> decltype(vis(0)) { diff --git a/include/fmt/format.h b/include/fmt/format.h index 1a05db31..0b410a23 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1038,6 +1038,7 @@ 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. @@ -4319,6 +4320,8 @@ inline auto to_string(const T& value) -> std::string { return to_string(format_as(value)); } +FMT_END_EXPORT + namespace detail { template @@ -4390,6 +4393,8 @@ void vformat_to(buffer& buf, basic_string_view fmt, detail::parse_format_string(fmt, format_handler(out, fmt, args, loc)); } +FMT_BEGIN_EXPORT + #ifndef FMT_HEADER_ONLY extern template FMT_API void vformat_to(buffer&, string_view, typename vformat_args<>::type,