Use FMT_THROW in report_error (#4521)

With exceptions: No change (if FMT_THROW is not user provided)

Without exceptions: Now also states where it comes from (report_error)
and uses fprintf instead of fputs.

My motivation is, now that I have my own fmt::assert_failed, also to get
rid of fputs for my embedded build.
This commit is contained in:
Björn Schäpers
2025-08-31 17:05:54 +02:00
committed by GitHub
parent e181e94140
commit ff1caa58c9

View File

@@ -147,12 +147,7 @@ FMT_FUNC void report_error(const char* message) {
volatile bool b = true;
if (!b) return;
#endif
#if FMT_USE_EXCEPTIONS
throw format_error(message);
#else
fputs(message, stderr);
abort();
#endif
FMT_THROW(format_error(message));
}
template <typename Locale> typename Locale::id format_facet<Locale>::id;