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