From c1b64740fb8867ceee67a5ea4c0e8d696d5b22da Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 18 Mar 2021 16:46:42 +0100 Subject: [PATCH] Use WINVER values instead of _WIN32_WINNT_[NAME]. WINVER values are well defined, see: https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-160 --- miniupnpc/addr_is_reserved.c | 2 +- miniupnpc/minissdpc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/miniupnpc/addr_is_reserved.c b/miniupnpc/addr_is_reserved.c index 7e586d7..18c6424 100644 --- a/miniupnpc/addr_is_reserved.c +++ b/miniupnpc/addr_is_reserved.c @@ -56,7 +56,7 @@ int addr_is_reserved(const char * addr_str) uint32_t addr_n, address; size_t i; -#if defined(_WIN32) && (!defined(_WIN32_WINNT_VISTA) || (_WIN32_WINNT < _WIN32_WINNT_VISTA)) +#if defined(_WIN32) && _WIN32_WINNT < 0x0600 // _WIN32_WINNT_VISTA addr_n = inet_addr(addr_str); if (addr_n == INADDR_NONE) return 1; diff --git a/miniupnpc/minissdpc.c b/miniupnpc/minissdpc.c index 0ef7e12..cf8aad6 100644 --- a/miniupnpc/minissdpc.c +++ b/miniupnpc/minissdpc.c @@ -460,7 +460,7 @@ parseMSEARCHReply(const char * reply, int size, static int upnp_gettimeofday(struct timeval * tv) { #if defined(_WIN32) -#if defined(_WIN32_WINNT_VISTA) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA) +#if _WIN32_WINNT >= 0x0600 // _WIN32_WINNT_VISTA ULONGLONG ts = GetTickCount64(); #else DWORD ts = GetTickCount(); @@ -722,7 +722,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[], } else { struct in_addr mc_if; #if defined(_WIN32) -#if defined(_WIN32_WINNT_VISTA) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA) +#if _WIN32_WINNT >= 0x0600 // _WIN32_WINNT_VISTA InetPtonA(AF_INET, multicastif, &mc_if); #else mc_if.s_addr = inet_addr(multicastif); /* old Windows SDK do not support InetPtoA() */