mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
because Windows....
This commit is contained in:
parent
7dbccf08ae
commit
7c72653385
2 changed files with 9 additions and 1 deletions
|
@ -142,11 +142,19 @@ char *InetAddress::toIpString(char buf[64]) const
|
||||||
buf[0] = (char)0;
|
buf[0] = (char)0;
|
||||||
switch(ss_family) {
|
switch(ss_family) {
|
||||||
case AF_INET: {
|
case AF_INET: {
|
||||||
|
#ifdef _WIN32
|
||||||
|
inet_ntop(AF_INET, (void*)&reinterpret_cast<const struct sockaddr_in *>(this)->sin_addr.s_addr, buf, INET_ADDRSTRLEN);
|
||||||
|
#else
|
||||||
inet_ntop(AF_INET, &reinterpret_cast<const struct sockaddr_in *>(this)->sin_addr.s_addr, buf, INET_ADDRSTRLEN);
|
inet_ntop(AF_INET, &reinterpret_cast<const struct sockaddr_in *>(this)->sin_addr.s_addr, buf, INET_ADDRSTRLEN);
|
||||||
|
#endif
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case AF_INET6: {
|
case AF_INET6: {
|
||||||
|
#ifdef _WIN32
|
||||||
|
inet_ntop(AF_INET6, (void*)reinterpret_cast<const struct sockaddr_in6 *>(this)->sin6_addr.s6_addr, buf, INET6_ADDRSTRLEN);
|
||||||
|
#else
|
||||||
inet_ntop(AF_INET6, reinterpret_cast<const struct sockaddr_in6 *>(this)->sin6_addr.s6_addr, buf, INET6_ADDRSTRLEN);
|
inet_ntop(AF_INET6, reinterpret_cast<const struct sockaddr_in6 *>(this)->sin6_addr.s6_addr, buf, INET6_ADDRSTRLEN);
|
||||||
|
#endif
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
return buf;
|
return buf;
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
#include <ShlObj.h>
|
#include <ShlObj.h>
|
||||||
#include <netioapi.h>
|
#include <netioapi.h>
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#include <unistd.h>
|
//#include <unistd.h>
|
||||||
#define stat _stat
|
#define stat _stat
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
Loading…
Add table
Reference in a new issue