Fix for compiling with old windows SDK
This commit is contained in:
parent
7a66f373fc
commit
138b4ff3aa
|
@ -55,13 +55,17 @@ int addr_is_reserved(const char * addr_str)
|
|||
uint32_t addr_n, address;
|
||||
size_t i;
|
||||
|
||||
#if defined(_WIN32) && (_WIN32_WINNT < _WIN32_WINNT_VISTA)
|
||||
addr_n = inet_addr(addr_str);
|
||||
if (addr_n == INADDR_NONE)
|
||||
return 1;
|
||||
#else
|
||||
/* was : addr_n = inet_addr(addr_str); */
|
||||
if (inet_pton(AF_INET, addr_str, &addr_n) < 0) {
|
||||
/* error */
|
||||
return 0;
|
||||
}
|
||||
if (addr_n == INADDR_NONE)
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
address = ntohl(addr_n);
|
||||
|
||||
|
|
|
@ -717,8 +717,12 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
|
|||
#endif
|
||||
} else {
|
||||
struct in_addr mc_if;
|
||||
#if defined(_WIN32) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
|
||||
#if defined(_WIN32)
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
|
||||
InetPtonA(AF_INET, multicastif, &mc_if);
|
||||
#else
|
||||
mc_if.s_addr = inet_addr(multicastif); /* old Windows SDK do not support InetPtoA() */
|
||||
#endif
|
||||
#else
|
||||
/* was : mc_if.s_addr = inet_addr(multicastif); */ /* ex: 192.168.x.x */
|
||||
if (inet_pton(AF_INET, multicastif, &mc_if.s_addr) < 0) {
|
||||
|
|
Loading…
Reference in New Issue