Add some type casts so it builds on VS2015 with a certain SDK
This commit is contained in:
parent
3f1b435b4e
commit
e116360538
2 changed files with 3 additions and 2 deletions
|
@ -987,7 +987,7 @@ DWORD SetMetricOnNetworkAdapter(NET_LUID *InterfaceLuid, ADDRESS_FAMILY family,
|
||||||
static const char *PrintIPV6(const uint8 new_address[16]) {
|
static const char *PrintIPV6(const uint8 new_address[16]) {
|
||||||
sockaddr_in6 sin6 = {0};
|
sockaddr_in6 sin6 = {0};
|
||||||
static char buf[100];
|
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);
|
memcpy(buf, "unknown", 8);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *print_ip_prefix(char buf[kSizeOfAddress], int family, const void *ip, int prefixlen) {
|
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);
|
memcpy(buf, "unknown", 8);
|
||||||
}
|
}
|
||||||
if (prefixlen >= 0)
|
if (prefixlen >= 0)
|
||||||
|
|
Loading…
Reference in a new issue