mirror of
https://github.com/fmtlib/fmt.git
synced 2026-05-01 03:19:24 +08:00
Use FMT_TRY and FMT_CATCH in C api
If exceptions are disabled, try/catch don't compile
This commit is contained in:
parent
2cb3983213
commit
8e9eecc288
@ -31,12 +31,12 @@ extern "C" int fmt_vformat(char* buffer, size_t size, const char* fmt,
|
||||
default: return fmt_error_invalid_arg;
|
||||
}
|
||||
}
|
||||
try {
|
||||
FMT_TRY {
|
||||
auto result = fmt::vformat_to_n(
|
||||
buffer, size, fmt,
|
||||
fmt::format_args(format_args, static_cast<int>(num_args)));
|
||||
return static_cast<int>(result.size);
|
||||
} catch (...) {
|
||||
} FMT_CATCH(...) {
|
||||
}
|
||||
return fmt_error;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user