shithub: duke3d

Download patch

ref: 1708377090ab43b7055b3cd4c4d2d002b68d00b2
parent: 97551ec08a6f8215cd7c1871ff5356be5c0fd366
author: Tanguy Fautre <[email protected]>
date: Sat Feb 22 20:51:59 EST 2020

Fix conditional compilation around IP_RECVERR, does not seem to be supported on MacOS X

--- a/Engine/src/macos_compat.h
+++ b/Engine/src/macos_compat.h
@@ -22,14 +22,11 @@
 #include <inttypes.h>
 
 #define O_BINARY 0
-
-#define UDP_NETWORKING 1
-
 #define PLATFORM_MACOSX 1
+//
+//#define SOL_IP SOL_SOCKET
+//#define IP_RECVERR  SO_BROADCAST
 
-#define SOL_IP SOL_SOCKET
-#define IP_RECVERR  SO_BROADCAST
-
 #define stricmp strcasecmp
 #define strcmpi strcasecmp
 
@@ -40,7 +37,5 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
-
-#define USER_DUMMY_NETWORK 1
 
 #endif
--- a/Engine/src/mmulti.c
+++ b/Engine/src/mmulti.c
@@ -960,7 +960,12 @@
 	printf("Stun is currently %s\n", (g_bStun) ? "Enabled":"Disabled");
 
     udpsocket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
+
+#if WIN32
+	if (udpsocket == INVALID_SOCKET)
+#else
     if (udpsocket == -1)
+#endif
     {
         printf("socket creation failed: %s\n", netstrerror());
         return(0);
@@ -969,7 +974,7 @@
     if (!set_socket_blockmode(0))
         return(0);
 
-    #if !WIN32
+    #if !WIN32 && !__APPLE__
     {
         /* !!! FIXME: Might be Linux (not Unix, not BSD, not WinSock) specific. */
         int flags = 1;