win32/ComWorker: fix the FormatHResultError() return type

Casting to std::runtime_error loses information (and prevents RVO).
This commit is contained in:
Max Kellermann 2021-03-05 13:17:22 +01:00
parent 7838265482
commit 932756efce

View File

@ -88,7 +88,7 @@ static inline const std::error_category &hresult_category() noexcept {
return hresult_category_instance;
}
gcc_printf(2, 3) static inline std::runtime_error
gcc_printf(2, 3) static inline std::system_error
FormatHResultError(HRESULT result, const char *fmt, ...) noexcept {
std::va_list args1, args2;
va_start(args1, fmt);