From 2b2acf1111a56ef960448f890a39302259e2426f Mon Sep 17 00:00:00 2001 From: opatomic Date: Fri, 24 Apr 2020 10:00:36 -0400 Subject: [PATCH] add support for win2k getaddrinfo() is not available on win2k. By including wspiapi.h (if _WIN32_WINNT is defined as value < 0x0501) then a compatibility layer will be used when running on win2k. For more details, refer to Microsoft docs for getaddrinfo(). Signed-off-by: opatomic --- library/net_sockets.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/net_sockets.c b/library/net_sockets.c index dbde510db..5c1e665ea 100644 --- a/library/net_sockets.c +++ b/library/net_sockets.c @@ -54,8 +54,7 @@ #define IS_EINTR( ret ) ( ( ret ) == WSAEINTR ) -#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501) -#undef _WIN32_WINNT +#if !defined(_WIN32_WINNT) /* Enables getaddrinfo() & Co */ #define _WIN32_WINNT 0x0501 #endif @@ -64,6 +63,9 @@ #include #include +#if (_WIN32_WINNT < 0x0501) +#include +#endif #if defined(_MSC_VER) #if defined(_WIN32_WCE)