]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix compatibility with pre-XP windows versions
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 May 2009 21:23:59 +0000 (21:23 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 May 2009 21:23:59 +0000 (21:23 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8964 d7cf8633-e32d-0410-b094-e92efae38249

lhnet.c

diff --git a/lhnet.c b/lhnet.c
index fd668b7ee6d83ac59c55bdb8d4f3e1838dd5de60..00a6c78b935b77e05dcd0332f8e242aa9d6c7051 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -1,6 +1,12 @@
 
 // Written by Forest Hale 2003-06-15 and placed into public domain.
 
+#ifdef WIN32
+// Windows XP or higher is required for getaddrinfo, but the inclusion of wspiapi provides fallbacks for older versions
+#include <ws2tcpip.h>
+#include <wspiapi.h>
+#endif
+
 #ifndef STANDALONETEST
 #include "quakedef.h"
 #endif
@@ -9,12 +15,7 @@
 #include <stdio.h>
 #include <time.h>
 #include <string.h>
-#ifdef WIN32
-#define _WIN32_WINNT 0x0501
-       // Windows XP or higher is required for getaddrinfo
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#else
+#ifndef WIN32
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>