Replace try and catch with the FMT_TRY and FMT_CATCH macros (#4751)
This commit is contained in:
@@ -31,12 +31,12 @@ extern "C" int fmt_vformat(char* buffer, size_t size, const char* fmt,
|
|||||||
default: return fmt_error_invalid_arg;
|
default: return fmt_error_invalid_arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
FMT_TRY {
|
||||||
auto result = fmt::vformat_to_n(
|
auto result = fmt::vformat_to_n(
|
||||||
buffer, size, fmt,
|
buffer, size, fmt,
|
||||||
fmt::format_args(format_args, static_cast<int>(num_args)));
|
fmt::format_args(format_args, static_cast<int>(num_args)));
|
||||||
return static_cast<int>(result.size);
|
return static_cast<int>(result.size);
|
||||||
} catch (...) {
|
|
||||||
}
|
}
|
||||||
|
FMT_CATCH(...) {}
|
||||||
return fmt_error;
|
return fmt_error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user