mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r3023) -Fix [BeOS] fixed compilation on BeOS R5 (MYOB)
This commit is contained in:
parent
37af5bc475
commit
2b44da199c
5
Makefile
5
Makefile
|
@ -380,12 +380,13 @@ endif
|
||||||
|
|
||||||
ifdef BEOS
|
ifdef BEOS
|
||||||
CDEFS += -DBEOS
|
CDEFS += -DBEOS
|
||||||
LDFLAGS += -lmidi -lbe
|
LDFLAGS += -lmidi -lbe -lpthread
|
||||||
ifdef WITH_NETWORK
|
ifdef WITH_NETWORK
|
||||||
ifdef BEOS_NET_SERVER
|
ifdef BEOS_NET_SERVER
|
||||||
CDEFS += -DBEOS_NET_SERVER
|
CDEFS += -DBEOS_NET_SERVER
|
||||||
|
LDFLAGS += -lnet
|
||||||
else
|
else
|
||||||
# Zeta needs a few more libraries than R5
|
# BONE needs a few more libraries than R5
|
||||||
LDFLAGS += -lbind -lsocket
|
LDFLAGS += -lbind -lsocket
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -350,7 +350,11 @@ bool NetworkUDPListen(SOCKET *udp, uint32 host, uint16 port, bool broadcast)
|
||||||
// set nonblocking mode for socket
|
// set nonblocking mode for socket
|
||||||
{
|
{
|
||||||
unsigned long blocking = 1;
|
unsigned long blocking = 1;
|
||||||
|
#ifndef BEOS_NET_SERVER
|
||||||
ioctlsocket(*udp, FIONBIO, &blocking);
|
ioctlsocket(*udp, FIONBIO, &blocking);
|
||||||
|
#else
|
||||||
|
setsockopt(*upd, SOL_SOCKET, SO_NONBLOCK, &blocking);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
|
@ -366,7 +370,9 @@ bool NetworkUDPListen(SOCKET *udp, uint32 host, uint16 port, bool broadcast)
|
||||||
if (broadcast) {
|
if (broadcast) {
|
||||||
/* Enable broadcast */
|
/* Enable broadcast */
|
||||||
unsigned long val = 1;
|
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));
|
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);
|
DEBUG(net, 1)("[NET][UDP] Listening on port %s:%d", inet_ntoa(*(struct in_addr *)&host), port);
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
#include "../variables.h"
|
#include "../variables.h"
|
||||||
#include "dedicated_v.h"
|
#include "dedicated_v.h"
|
||||||
|
|
||||||
|
#ifdef BEOS_NET_SERVER
|
||||||
|
#include <net/socket.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __OS2__
|
#ifdef __OS2__
|
||||||
# include <sys/time.h> /* gettimeofday */
|
# include <sys/time.h> /* gettimeofday */
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
|
Loading…
Reference in New Issue