From 52afcb795fbe94215c6bafb794f9f9aab14cd4b5 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 6 May 2019 12:51:01 +0100 Subject: [PATCH] Fix windows build --- src/openrct2-ui/windows/ServerList.cpp | 4 ++-- src/openrct2/network/Socket.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index dfef1b6bb9..80ce64a33f 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -557,7 +557,7 @@ static void server_list_fetch_servers_begin() auto entries = lanF.get(); allEntries.insert(allEntries.end(), entries.begin(), entries.end()); } - catch (const std::exception& e) + catch (...) { } @@ -571,7 +571,7 @@ static void server_list_fetch_servers_begin() { status = e.StatusText; } - catch (const std::exception& e) + catch (...) { status = STR_SERVER_LIST_NO_CONNECTION; } diff --git a/src/openrct2/network/Socket.cpp b/src/openrct2/network/Socket.cpp index fe93b295ea..3fc5b80c10 100644 --- a/src/openrct2/network/Socket.cpp +++ b/src/openrct2/network/Socket.cpp @@ -819,7 +819,7 @@ std::unique_ptr CreateUdpSocket() } # ifdef _WIN32 -std::vector GetNetworkInterfaces() +static std::vector GetNetworkInterfaces() { int sock = socket(AF_INET, SOCK_DGRAM, 0); if (sock == -1) @@ -834,8 +834,8 @@ std::vector GetNetworkInterfaces() { interfaces.resize(capacity); if (WSAIoctl( - sock, SIO_GET_INTERFACE_LIST, nullptr, 0, interfaces.data(), capacity * sizeof(INTERFACE_INFO), &len, nullptr, - nullptr) + sock, SIO_GET_INTERFACE_LIST, nullptr, 0, interfaces.data(), (DWORD)(capacity * sizeof(INTERFACE_INFO)), &len, + nullptr, nullptr) == 0) { break; @@ -870,7 +870,7 @@ std::vector> GetBroadcastAddresses() memcpy(&address, &ifo.iiAddress.Address, sizeof(sockaddr)); ((sockaddr_in*)&address)->sin_addr.s_addr = ifo.iiAddress.AddressIn.sin_addr.s_addr | ~ifo.iiNetmask.AddressIn.sin_addr.s_addr; - baddresses.push_back(std::make_unique(address, sizeof(sockaddr))); + baddresses.push_back(std::make_unique((const sockaddr*)&address, (socklen_t)sizeof(sockaddr))); } # else int sock = socket(AF_INET, SOCK_DGRAM, 0);