summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-10-06 18:28:27 +0000
committerbjarni <bjarni@openttd.org>2005-10-06 18:28:27 +0000
commit488db23ed85c4a5fd0ed27833cbd9e05be3a5c94 (patch)
treecc2100f641ee2903f4dcf05e68f1774eeec73708
parentcebca8e61b08eca4434b217d3a5f6a456c89d2d3 (diff)
downloadopenttd-488db23ed85c4a5fd0ed27833cbd9e05be3a5c94.tar.xz
(svn r3023) -Fix [BeOS] fixed compilation on BeOS R5 (MYOB)
-rw-r--r--Makefile5
-rw-r--r--network_udp.c6
-rw-r--r--video/dedicated_v.c4
3 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 13b019212..23ea10094 100644
--- a/Makefile
+++ b/Makefile
@@ -380,12 +380,13 @@ endif
ifdef BEOS
CDEFS += -DBEOS
-LDFLAGS += -lmidi -lbe
+LDFLAGS += -lmidi -lbe -lpthread
ifdef WITH_NETWORK
ifdef BEOS_NET_SERVER
CDEFS += -DBEOS_NET_SERVER
+ LDFLAGS += -lnet
else
- # Zeta needs a few more libraries than R5
+ # BONE needs a few more libraries than R5
LDFLAGS += -lbind -lsocket
endif
endif
diff --git a/network_udp.c b/network_udp.c
index e2138a6a4..7d664f38a 100644
--- a/network_udp.c
+++ b/network_udp.c
@@ -350,7 +350,11 @@ bool NetworkUDPListen(SOCKET *udp, uint32 host, uint16 port, bool broadcast)
// set nonblocking mode for socket
{
unsigned long blocking = 1;
+#ifndef BEOS_NET_SERVER
ioctlsocket(*udp, FIONBIO, &blocking);
+#else
+ setsockopt(*upd, SOL_SOCKET, SO_NONBLOCK, &blocking);
+#endif
}
sin.sin_family = AF_INET;
@@ -366,7 +370,9 @@ bool NetworkUDPListen(SOCKET *udp, uint32 host, uint16 port, bool broadcast)
if (broadcast) {
/* Enable broadcast */
unsigned long val = 1;
+#ifndef BEOS_NET_SERVER // will work around this, some day; maybe.
setsockopt(*udp, SOL_SOCKET, SO_BROADCAST, (char *) &val , sizeof(val));
+#endif
}
DEBUG(net, 1)("[NET][UDP] Listening on port %s:%d", inet_ntoa(*(struct in_addr *)&host), port);
diff --git a/video/dedicated_v.c b/video/dedicated_v.c
index 2700ae4cf..3e016959d 100644
--- a/video/dedicated_v.c
+++ b/video/dedicated_v.c
@@ -15,6 +15,10 @@
#include "../variables.h"
#include "dedicated_v.h"
+#ifdef BEOS_NET_SERVER
+#include <net/socket.h>
+#endif
+
#ifdef __OS2__
# include <sys/time.h> /* gettimeofday */
# include <sys/types.h>