From b5191dde6f49cffc8759cf01e46d11004488d824 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Fri, 28 Jul 2017 21:14:59 +0200 Subject: [PATCH] sockets: fix Windows 2000 build (#450) Commit 4630a5dab66a0e18ec8dfc0998ac223e40b3dc13 broke compilation for Windows 2000 and earlier as getaddrinfo was introduced in Windows XP. Fix this by including when targeting Windows 2000 and earlier, which falls back to an inline implementation of getaddrinfo when necessary. Some MinGW flavors still target Windows 2000 by default. Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/ms738520.aspx, section "Support for getaddrinfo on Windows 2000 and older versions" --- socketft.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/socketft.cpp b/socketft.cpp index 54e52289..454eaa57 100644 --- a/socketft.cpp +++ b/socketft.cpp @@ -30,8 +30,11 @@ # include #endif -#ifdef PREFER_WINDOWS_STYLE_SOCKETS +#ifdef USE_WINDOWS_STYLE_SOCKETS # pragma comment(lib, "ws2_32.lib") +# if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x501) +# include +# endif #endif NAMESPACE_BEGIN(CryptoPP)