MingW and _WIN32_WINNT

Gisle Vanem <[email protected]> Tue, 12 Dec 2006 11:14:05 +0100
Newsgroups gmane.comp.web.wget.patches
Message-ID <[email protected]>
The below patches is needed with the latest MingW headers
(e.g. <ws2tcpip.h>). I'll not go into as to why one should need it...

--- SVN-Latest/windows/config-compiler.h        Wed Nov 01 15:31:42 2006
+++ windows/config-compiler.h   Tue Dec 12 11:09:47 2006
@@ -91,6 +91,15 @@
 #define HAVE_UINTPTR_T 1

 #define HAVE_STRTOLL 1
+
+/* MingW needs _WIN32_WINNT==0x0501 defined to pull in getaddrinfo()
+ * and freeaddrinfo() etc.
+ */
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501)
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
+
 ♀
 /* -------------------- */
 /* MS Visual C section. */

--gv