mirror of
https://github.com/fmtlib/fmt.git
synced 2026-04-30 19:09:22 +08:00
Replace try and catch with the FMT_TRY and FMT_CATCH macros (#4751)
This commit is contained in:
parent
2cb3983213
commit
4b50ad7944
@ -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