mirror of
https://github.com/fmtlib/fmt.git
synced 2025-09-26 14:40:55 +02:00
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:
@@ -147,12 +147,7 @@ FMT_FUNC void report_error(const char* message) {
|
|||||||
volatile bool b = true;
|
volatile bool b = true;
|
||||||
if (!b) return;
|
if (!b) return;
|
||||||
#endif
|
#endif
|
||||||
#if FMT_USE_EXCEPTIONS
|
FMT_THROW(format_error(message));
|
||||||
throw format_error(message);
|
|
||||||
#else
|
|
||||||
fputs(message, stderr);
|
|
||||||
abort();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Locale> typename Locale::id format_facet<Locale>::id;
|
template <typename Locale> typename Locale::id format_facet<Locale>::id;
|
||||||
|
Reference in New Issue
Block a user