]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - lhnet.c
more work on mod_generatelightmaps
[xonotic/darkplaces.git] / lhnet.c
diff --git a/lhnet.c b/lhnet.c
index 1e90318fe603a53bc8b1aa0eb0abc03df2a73eae..6b049d2890b8cd79fc3df1acf0383af0cf31e060 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -3,10 +3,12 @@
 
 #ifdef WIN32
 // Windows XP or higher is required for getaddrinfo, but the inclusion of wspiapi provides fallbacks for older versions
-#define _WIN32_WINNT 0x0501
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <wspiapi.h>
+# define _WIN32_WINNT 0x0501
+# include <winsock2.h>
+# include <ws2tcpip.h>
+# ifdef USE_WSPIAPI_H
+#  include <wspiapi.h>
+# endif
 #endif
 
 #ifndef STANDALONETEST
@@ -728,7 +730,7 @@ lhnetsocket_t *LHNET_OpenSocket_Connectionless(lhnetaddress_t *address)
                                                int ipv6_only = 1;
                                                if (address->addresstype != LHNETADDRESSTYPE_INET6
                                                        || setsockopt (lhnetsocket->inetsocket, IPPROTO_IPV6, IPV6_V6ONLY,
-                                                                                  (const void *)&ipv6_only, sizeof(ipv6_only)) == 0
+                                                                                  (const char *)&ipv6_only, sizeof(ipv6_only)) == 0
 #ifdef WIN32
                                                        // The Win32 API only supports IPV6_V6ONLY since Windows Vista, but fortunately
                                                        // the default value is what we want on Win32 anyway (IPV6_V6ONLY = true)
@@ -878,7 +880,7 @@ int LHNET_Read(lhnetsocket_t *lhnetsocket, void *content, int maxcontentlength,
                SOCKLEN_T inetaddresslength;
                address->addresstype = LHNETADDRESSTYPE_NONE;
                inetaddresslength = sizeof(address->addr.in);
-               value = recvfrom(lhnetsocket->inetsocket, content, maxcontentlength, 0, &address->addr.sock, &inetaddresslength);
+               value = recvfrom(lhnetsocket->inetsocket, (char *)content, maxcontentlength, 0, &address->addr.sock, &inetaddresslength);
                if (value > 0)
                {
                        address->addresstype = LHNETADDRESSTYPE_INET4;
@@ -904,7 +906,7 @@ int LHNET_Read(lhnetsocket_t *lhnetsocket, void *content, int maxcontentlength,
                SOCKLEN_T inetaddresslength;
                address->addresstype = LHNETADDRESSTYPE_NONE;
                inetaddresslength = sizeof(address->addr.in6);
-               value = recvfrom(lhnetsocket->inetsocket, content, maxcontentlength, 0, &address->addr.sock, &inetaddresslength);
+               value = recvfrom(lhnetsocket->inetsocket, (char *)content, maxcontentlength, 0, &address->addr.sock, &inetaddresslength);
                if (value > 0)
                {
                        address->addresstype = LHNETADDRESSTYPE_INET6;
@@ -957,7 +959,7 @@ int LHNET_Write(lhnetsocket_t *lhnetsocket, const void *content, int contentleng
        }
        else if (lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET4)
        {
-               value = sendto(lhnetsocket->inetsocket, content, contentlength, 0, (struct sockaddr *)&address->addr.in, sizeof(struct sockaddr_in));
+               value = sendto(lhnetsocket->inetsocket, (char *)content, contentlength, 0, (struct sockaddr *)&address->addr.in, sizeof(struct sockaddr_in));
                if (value == -1)
                {
                        if (SOCKETERRNO == EWOULDBLOCK)
@@ -967,7 +969,7 @@ int LHNET_Write(lhnetsocket_t *lhnetsocket, const void *content, int contentleng
        }
        else if (lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET6)
        {
-               value = sendto(lhnetsocket->inetsocket, content, contentlength, 0, (struct sockaddr *)&address->addr.in6, sizeof(struct sockaddr_in6));
+               value = sendto(lhnetsocket->inetsocket, (char *)content, contentlength, 0, (struct sockaddr *)&address->addr.in6, sizeof(struct sockaddr_in6));
                if (value == -1)
                {
                        if (SOCKETERRNO == EWOULDBLOCK)