From 70643b25111140c090c08385795fcf76e622b6da Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 8 Sep 2024 15:56:36 -0700 Subject: [PATCH] Don't use format_error if exceptions disabled --- include/fmt/format-inl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index bdf93013..d0e97df0 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -131,7 +131,12 @@ FMT_FUNC auto write_loc(appender out, loc_value value, } // namespace detail FMT_FUNC void report_error(const char* message) { - FMT_THROW(format_error(message)); +#if FMT_EXCEPTIONS + throw format_error(message); +#else + fputs(message, stderr); + abort(); +#endif } template typename Locale::id format_facet::id;