diff --git a/include/fmt/core.h b/include/fmt/core.h index e548ce6d..8848939f 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -178,8 +178,8 @@ } #endif -#ifndef FMT_MODULE_EXPORT -# define FMT_MODULE_EXPORT +#ifndef FMT_EXPORT +# define FMT_EXPORT # define FMT_BEGIN_EXPORT # define FMT_END_EXPORT #endif @@ -397,7 +397,7 @@ FMT_CONSTEXPR inline auto is_utf8() -> bool { compiled with a different ``-std`` option than the client code (which is not recommended). */ -FMT_MODULE_EXPORT +FMT_EXPORT template class basic_string_view { private: const Char* data_; @@ -500,11 +500,11 @@ template class basic_string_view { } }; -FMT_MODULE_EXPORT +FMT_EXPORT using string_view = basic_string_view; /** Specifies if ``T`` is a character type. Can be specialized by users. */ -FMT_MODULE_EXPORT +FMT_EXPORT template struct is_char : std::false_type {}; template <> struct is_char : std::true_type {}; @@ -652,7 +652,7 @@ template using char_t = typename detail::char_t_impl::type; You can use the ``format_parse_context`` type alias for ``char`` instead. \endrst */ -FMT_MODULE_EXPORT +FMT_EXPORT template class basic_format_parse_context { private: basic_string_view format_str_; @@ -718,7 +718,7 @@ template class basic_format_parse_context { FMT_CONSTEXPR void check_dynamic_spec(int arg_id); }; -FMT_MODULE_EXPORT +FMT_EXPORT using format_parse_context = basic_format_parse_context; namespace detail { @@ -1060,12 +1060,12 @@ FMT_CONSTEXPR void basic_format_parse_context::check_dynamic_spec( } } -FMT_MODULE_EXPORT template class basic_format_arg; -FMT_MODULE_EXPORT template class basic_format_args; -FMT_MODULE_EXPORT template class dynamic_format_arg_store; +FMT_EXPORT template class basic_format_arg; +FMT_EXPORT template class basic_format_args; +FMT_EXPORT template class dynamic_format_arg_store; // A formatter for objects of type T. -FMT_MODULE_EXPORT +FMT_EXPORT template struct formatter { // A deleted default constructor indicates a disabled formatter. @@ -1647,7 +1647,7 @@ template class basic_format_arg { ``vis(value)`` will be called with the value of type ``double``. \endrst */ -FMT_MODULE_EXPORT +FMT_EXPORT template FMT_CONSTEXPR FMT_INLINE auto visit_format_arg( Visitor&& vis, const basic_format_arg& arg) -> decltype(vis(0)) { @@ -1955,7 +1955,7 @@ template class basic_format_args { /** An alias to ``basic_format_args``. */ // A separate type would result in shorter symbols but break ABI compatibility // between clang and gcc on ARM (#1919). -FMT_MODULE_EXPORT using format_args = basic_format_args; +FMT_EXPORT using format_args = basic_format_args; // We cannot use enum classes as bit fields because of a gcc bug, so we put them // in namespaces instead (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414). diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index ce65909b..a112fe7b 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -155,7 +155,7 @@ inline void vprint_directly(std::ostream& os, string_view format_str, } // namespace detail -FMT_MODULE_EXPORT template +FMT_EXPORT template void vprint(std::basic_ostream& os, basic_string_view> format_str, basic_format_args>> args) { @@ -174,7 +174,7 @@ void vprint(std::basic_ostream& os, fmt::print(cerr, "Don't {}!", "panic"); \endrst */ -FMT_MODULE_EXPORT template +FMT_EXPORT template void print(std::ostream& os, format_string fmt, T&&... args) { const auto& vargs = fmt::make_format_args(args...); if (detail::is_utf8()) @@ -183,7 +183,7 @@ void print(std::ostream& os, format_string fmt, T&&... args) { detail::vprint_directly(os, fmt, vargs); } -FMT_MODULE_EXPORT +FMT_EXPORT template void print(std::wostream& os, basic_format_string...> fmt, @@ -191,12 +191,12 @@ void print(std::wostream& os, vprint(os, fmt, fmt::make_format_args>(args...)); } -FMT_MODULE_EXPORT template +FMT_EXPORT template void println(std::ostream& os, format_string fmt, T&&... args) { fmt::print(os, "{}\n", fmt::format(fmt, std::forward(args)...)); } -FMT_MODULE_EXPORT +FMT_EXPORT template void println(std::wostream& os, basic_format_string...> fmt, diff --git a/include/fmt/std.h b/include/fmt/std.h index 1fda6154..ac395650 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -75,7 +75,7 @@ inline void write_escaped_path( } // namespace detail -FMT_MODULE_EXPORT +FMT_EXPORT template struct formatter : formatter> { @@ -97,14 +97,14 @@ FMT_END_NAMESPACE #endif FMT_BEGIN_NAMESPACE -FMT_MODULE_EXPORT +FMT_EXPORT template struct formatter : basic_ostream_formatter {}; FMT_END_NAMESPACE #ifdef __cpp_lib_optional FMT_BEGIN_NAMESPACE -FMT_MODULE_EXPORT +FMT_EXPORT template struct formatter, Char, std::enable_if_t::value>> { @@ -148,7 +148,7 @@ FMT_END_NAMESPACE #ifdef __cpp_lib_variant FMT_BEGIN_NAMESPACE -FMT_MODULE_EXPORT +FMT_EXPORT template struct formatter { template FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { @@ -206,7 +206,7 @@ template struct is_variant_formattable { detail::is_variant_formattable_::value; }; -FMT_MODULE_EXPORT +FMT_EXPORT template struct formatter< Variant, Char, @@ -240,7 +240,7 @@ FMT_END_NAMESPACE #endif // __cpp_lib_variant FMT_BEGIN_NAMESPACE -FMT_MODULE_EXPORT +FMT_EXPORT template struct formatter { template FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { @@ -258,7 +258,7 @@ template struct formatter { } }; -FMT_MODULE_EXPORT +FMT_EXPORT template struct formatter< T, Char, diff --git a/src/fmt.cc b/src/fmt.cc index 8ce91af5..b9abebfc 100644 --- a/src/fmt.cc +++ b/src/fmt.cc @@ -72,7 +72,7 @@ module; export module fmt; -#define FMT_MODULE_EXPORT export +#define FMT_EXPORT export #define FMT_BEGIN_EXPORT export { #define FMT_END_EXPORT } #define FMT_BEGIN_DETAIL_NAMESPACE \ @@ -102,14 +102,13 @@ extern "C++" { #include "fmt/std.h" #include "fmt/xchar.h" - #ifdef FMT_ATTACH_TO_GLOBAL_MODULE } #endif // gcc doesn't yet implement private module fragments #if !FMT_GCC_VERSION -module :private; +module : private; #endif #include "format.cc"