Skip to content

Commit

Permalink
Fix ABI compatiblity issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jan 5, 2022
1 parent 214cf13 commit 98cbb6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,7 @@ struct error_handler {
constexpr error_handler(const error_handler&) = default;

// This function is intentionally not constexpr to give a compile-time error.
// This function is marked as FMT_API for backwards compatibility, see #2695.
FMT_NORETURN FMT_API void on_error(const char* message) { throw_format_error(message); }
FMT_NORETURN FMT_API void on_error(const char* message);
};
FMT_END_DETAIL_NAMESPACE

Expand Down
6 changes: 6 additions & 0 deletions include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2575,6 +2575,12 @@ FMT_FUNC void report_system_error(int error_code,
report_error(format_system_error, error_code, message);
}

// DEPRECATED!
// This function is defined here and not inline for ABI compatiblity.
FMT_FUNC void detail::error_handler::on_error(const char* message) {
throw_format_error(message);
}

FMT_FUNC std::string vformat(string_view fmt, format_args args) {
// Don't optimize the "{}" case to keep the binary size small and because it
// can be better optimized in fmt::format anyway.
Expand Down

0 comments on commit 98cbb6a

Please sign in to comment.