From 551b3bf4bbde8160a97b32a0a760d617fedf9a70 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 16 Jun 2023 14:26:51 +0200 Subject: [PATCH] Don't force the _WIN32_WINT version If the user has set a value in the build environment, it will be used. Otherwise, if SDK has a default value, it will be picked. If either of these values are lower than 0x0501 (XP) we should not force some calls that will not work on the minimum target OS. We should use dynamic loading of these API's to support them in higher versions of the OS. winsock2.h needs to be included before windows.h and will pick the default _WIN32_WINNT from the SDK or use the one from the user, by setting _WIN32_WINNT in the CFLAGS. Signed-off-by: Steve Lhomme --- library/net_sockets.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/library/net_sockets.c b/library/net_sockets.c index e63d08b15..dcc85ae7b 100644 --- a/library/net_sockets.c +++ b/library/net_sockets.c @@ -49,11 +49,6 @@ #define IS_EINTR(ret) ((ret) == WSAEINTR) -#if !defined(_WIN32_WINNT) -/* Enables getaddrinfo() & Co */ -#define _WIN32_WINNT 0x0501 -#endif - #include #include