From 0cea6c2960eb4282efa6d1633681afaa9a47e211 Mon Sep 17 00:00:00 2001 From: Ludvig Strigeus Date: Mon, 10 Sep 2018 23:44:47 +0200 Subject: [PATCH] Add more type casts so it builds on VS2015 with a certain SDK --- network_win32.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/network_win32.cpp b/network_win32.cpp index 5a45ce5..117e55c 100644 --- a/network_win32.cpp +++ b/network_win32.cpp @@ -987,6 +987,7 @@ DWORD SetMetricOnNetworkAdapter(NET_LUID *InterfaceLuid, ADDRESS_FAMILY family, static const char *PrintIPV6(const uint8 new_address[16]) { sockaddr_in6 sin6 = {0}; static char buf[100]; + // cast to void* to work on VS2015 if (!inet_ntop(PF_INET6, (void*)new_address, buf, 100)) memcpy(buf, "unknown", 8); return buf; @@ -1052,7 +1053,7 @@ static bool SetIPV6DnsOnInterface(NET_LUID *InterfaceLuid, const uint8 new_addre if (ConvertInterfaceLuidToIndex(InterfaceLuid, &InterfaceIndex)) return false; if (IsIpv6AddressSet(new_address)) { - if (!inet_ntop(AF_INET6, new_address, ipv6, sizeof(ipv6))) + if (!inet_ntop(AF_INET6, (void*)new_address, ipv6, sizeof(ipv6))) return false; snprintf(buf, sizeof(buf), "netsh interface ipv6 set dns name=%d static %s validate=no", InterfaceIndex, ipv6);