From 461e46b814a5b49ffaebd308ddb6ed886f2913fd Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 20 Aug 2009 11:30:38 +0200 Subject: Improve checks for Windows version and wspiapi.h. --- libssh/connect.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'libssh/connect.c') diff --git a/libssh/connect.c b/libssh/connect.c index e08cd16..d8898ef 100644 --- a/libssh/connect.c +++ b/libssh/connect.c @@ -28,13 +28,25 @@ #include #ifdef _WIN32 -/* getaddrinfo, freeaddrinfo, getnameinfo */ -#define _WIN32_WINNT 0x0501 +/* + * Only use Windows API functions available on Windows 2000 SP4 or later. + * The available constants are in . + * http://msdn.microsoft.com/en-us/library/aa383745.aspx + * http://blogs.msdn.com/oldnewthing/archive/2007/04/11/2079137.aspx + */ +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 /* _WIN32_WINNT_WIN2K */ +#undef NTDDI_VERSION +#define NTDDI_VERSION 0x05000400 /* NTDDI_WIN2KSP4 */ #include #include -#include "wspiapi.h" /* Workaround for w2k systems */ +/* is necessary for getaddrinfo before Windows XP, but it isn't + * available on some platforms like MinGW. */ +#ifdef HAVE_WSPIAPI_H +#include +#endif #else /* _WIN32 */ -- cgit