From e116360538cc7a11b8ae1e74cd6bead4b5277ee5 Mon Sep 17 00:00:00 2001 From: Ludvig Strigeus Date: Sun, 12 Aug 2018 13:04:44 +0200 Subject: [PATCH] Add some type casts so it builds on VS2015 with a certain SDK --- network_win32.cpp | 2 +- wireguard_config.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/network_win32.cpp b/network_win32.cpp index d364611..5a45ce5 100644 --- a/network_win32.cpp +++ b/network_win32.cpp @@ -987,7 +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]; - if (!inet_ntop(PF_INET6, new_address, buf, 100)) + if (!inet_ntop(PF_INET6, (void*)new_address, buf, 100)) memcpy(buf, "unknown", 8); return buf; } diff --git a/wireguard_config.cpp b/wireguard_config.cpp index dbc67b0..974f768 100644 --- a/wireguard_config.cpp +++ b/wireguard_config.cpp @@ -25,7 +25,8 @@ #endif const char *print_ip_prefix(char buf[kSizeOfAddress], int family, const void *ip, int prefixlen) { - if (!inet_ntop(family, ip, buf, kSizeOfAddress - 8)) { + // cast to void* to work on VS2015 + if (!inet_ntop(family, (void*)ip, buf, kSizeOfAddress - 8)) { memcpy(buf, "unknown", 8); } if (prefixlen >= 0)