]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - lhnet.c
336
[xonotic/darkplaces.git] / lhnet.c
diff --git a/lhnet.c b/lhnet.c
index 48a2c2c34bea3059849ea66f003d1e978b04da50..ede0e7e2fd1c3032f101a5697680394e157f2e97 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -24,6 +24,8 @@
 #include "sys.h"
 #include "netconn.h"
 #else
+#define Con_Print printf
+#define Con_Printf printf
 #define Z_Malloc malloc
 #define Z_Free free
 #endif
@@ -457,7 +459,12 @@ lhnetsocket_t *LHNET_OpenSocket_Connectionless(lhnetaddress_t *address)
                                        if (ioctl(lhnetsocket->inetsocket, FIONBIO, &_true) != -1)
 #endif
                                        {
-                                               size_t namelen = address->addresstype == LHNETADDRESSTYPE_INET6 ? sizeof(lhnetsocket->address.addressdata.inet6) : sizeof(lhnetsocket->address.addressdata.inet4);
+#ifdef WIN32
+                                               int namelen;
+#else
+                                               socklen_t namelen;
+#endif
+                                               namelen = address->addresstype == LHNETADDRESSTYPE_INET6 ? sizeof(lhnetsocket->address.addressdata.inet6) : sizeof(lhnetsocket->address.addressdata.inet4);
                                                if (bind(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, namelen) != -1)
                                                {
                                                        getsockname(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, &namelen);