Index: config-win32.h
===================================================================
--- config-win32.h	(Revision 4088)
+++ config-win32.h	(Arbeitskopie)
@@ -575,6 +575,24 @@
 #  endif
 #endif
 
+/* __BORLANDC__ seems to always end up having _WIN32_WINNT defined, in the end,
+   system wide headers may do it automatically. Doing it early makes checks for
+   different headers, functions and such easier. */
+#if defined(__BORLANDC__) && !defined(_WIN32_WINNT)
+#  // XE4+ supports at least Windows 7.
+#  if __BORLANDC__ >= 0x0660
+#    define _WIN32_WINNT 0x0601
+#  // XE+ supports at least Windows XP.
+#  elif __BORLANDC__ >= 0x0630
+#    define _WIN32_WINNT 0x0501
+#  elif
+#    error _WIN32_WINNT should be defined early!
+#  endif
+#endif
+#if defined(__BORLANDC__) && !defined(WINVER)
+#  define WINVER _WIN32_WINNT
+#endif
+
 /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
    quite convoluted, compiler dependent and even build target dependent. */
 #if defined(HAVE_WS2TCPIP_H)
