mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-21 23:03:04 +01:00
Fix windows build
This commit is contained in:
@@ -557,7 +557,7 @@ static void server_list_fetch_servers_begin()
|
|||||||
auto entries = lanF.get();
|
auto entries = lanF.get();
|
||||||
allEntries.insert(allEntries.end(), entries.begin(), entries.end());
|
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;
|
status = e.StatusText;
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch (...)
|
||||||
{
|
{
|
||||||
status = STR_SERVER_LIST_NO_CONNECTION;
|
status = STR_SERVER_LIST_NO_CONNECTION;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -819,7 +819,7 @@ std::unique_ptr<IUdpSocket> CreateUdpSocket()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
std::vector<INTERFACE_INFO> GetNetworkInterfaces()
|
static std::vector<INTERFACE_INFO> GetNetworkInterfaces()
|
||||||
{
|
{
|
||||||
int sock = socket(AF_INET, SOCK_DGRAM, 0);
|
int sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
if (sock == -1)
|
if (sock == -1)
|
||||||
@@ -834,8 +834,8 @@ std::vector<INTERFACE_INFO> GetNetworkInterfaces()
|
|||||||
{
|
{
|
||||||
interfaces.resize(capacity);
|
interfaces.resize(capacity);
|
||||||
if (WSAIoctl(
|
if (WSAIoctl(
|
||||||
sock, SIO_GET_INTERFACE_LIST, nullptr, 0, interfaces.data(), capacity * sizeof(INTERFACE_INFO), &len, nullptr,
|
sock, SIO_GET_INTERFACE_LIST, nullptr, 0, interfaces.data(), (DWORD)(capacity * sizeof(INTERFACE_INFO)), &len,
|
||||||
nullptr)
|
nullptr, nullptr)
|
||||||
== 0)
|
== 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@@ -870,7 +870,7 @@ std::vector<std::unique_ptr<INetworkEndpoint>> GetBroadcastAddresses()
|
|||||||
memcpy(&address, &ifo.iiAddress.Address, sizeof(sockaddr));
|
memcpy(&address, &ifo.iiAddress.Address, sizeof(sockaddr));
|
||||||
((sockaddr_in*)&address)->sin_addr.s_addr = ifo.iiAddress.AddressIn.sin_addr.s_addr
|
((sockaddr_in*)&address)->sin_addr.s_addr = ifo.iiAddress.AddressIn.sin_addr.s_addr
|
||||||
| ~ifo.iiNetmask.AddressIn.sin_addr.s_addr;
|
| ~ifo.iiNetmask.AddressIn.sin_addr.s_addr;
|
||||||
baddresses.push_back(std::make_unique<NetworkEndpoint>(address, sizeof(sockaddr)));
|
baddresses.push_back(std::make_unique<NetworkEndpoint>((const sockaddr*)&address, (socklen_t)sizeof(sockaddr)));
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
int sock = socket(AF_INET, SOCK_DGRAM, 0);
|
int sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user