1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

Windows: Check WSAStartup result

This commit is contained in:
Megamouse 2022-12-06 23:41:37 +01:00
parent 69e4138223
commit b49f8623f6

View File

@ -490,8 +490,11 @@ int main(int argc, char** argv)
report_fatal_error("Not enough memory for RPCS3 process.");
}
WSADATA wsa_data;
WSAStartup(MAKEWORD(2, 2), &wsa_data);
WSADATA wsa_data{};
if (const int res = WSAStartup(MAKEWORD(2, 2), &wsa_data); res != 0)
{
report_fatal_error(fmt::format("WSAStartup failed (error=%s)", fmt::win_error_to_string(res, nullptr)));
}
#endif
ensure(thread_ctrl::is_main(), "Not main thread");