1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 12:39:11 +00:00

Remove: BeOS support (deprecated by Haiku)

In 10 years there is no commit to change how BeOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).

With the arrival of SDL2 (and removal of SDL), BeOS is no longer
support. SDL2 suggests to use Haiku instead of BeOS.
This commit is contained in:
Patric Stout
2019-03-04 19:46:11 +01:00
parent ad30d04b5e
commit f58db44ff2
74 changed files with 31 additions and 144 deletions

View File

@@ -24,7 +24,7 @@
*/
static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast);
#if defined(BEOS_NET_SERVER) || defined(__HAIKU__) /* doesn't have neither getifaddrs or net/if.h */
#if defined(__HAIKU__) /* doesn't have neither getifaddrs or net/if.h */
/* Based on Andrew Bachmann's netstat+.c. Big thanks to him! */
extern "C" int _netstat(int fd, char **output, int verbose);

View File

@@ -49,9 +49,7 @@ typedef unsigned long in_addr_t;
# define SOCKET int
# define INVALID_SOCKET -1
# define ioctlsocket ioctl
# if !defined(BEOS_NET_SERVER)
# define closesocket close
# endif
# define closesocket close
# define GET_LAST_ERROR() (errno)
/* Need this for FIONREAD on solaris */
# define BSD_COMP
@@ -59,37 +57,25 @@ typedef unsigned long in_addr_t;
/* Includes needed for UNIX-like systems */
# include <unistd.h>
# include <sys/ioctl.h>
# if defined(__BEOS__) && defined(BEOS_NET_SERVER)
# include <be/net/socket.h>
# include <be/kernel/OS.h> /* snooze() */
# include <be/net/netdb.h>
typedef unsigned long in_addr_t;
# define INADDR_NONE INADDR_BROADCAST
# else
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
# include <arpa/inet.h>
# include <net/if.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
# include <arpa/inet.h>
# include <net/if.h>
/* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */
# if !defined(__sgi__) && !defined(SUNOS) && !defined(__BEOS__) && !defined(__HAIKU__) && !defined(__INNOTEK_LIBC__) \
&& !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX)
# if !defined(__sgi__) && !defined(SUNOS) && !defined(__HAIKU__) && !defined(__INNOTEK_LIBC__) \
&& !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX)
/* If for any reason ifaddrs.h does not exist on your system, comment out
* the following two lines and an alternative way will be used to fetch
* the list of IPs from the system. */
# include <ifaddrs.h>
# define HAVE_GETIFADDRS
# endif
# if !defined(INADDR_NONE)
# define INADDR_NONE 0xffffffff
# endif
# if defined(__BEOS__) && !defined(BEOS_NET_SERVER)
/* needed on Zeta */
# include <sys/sockio.h>
# endif
# endif /* BEOS_NET_SERVER */
# include <ifaddrs.h>
# define HAVE_GETIFADDRS
# endif
# if !defined(INADDR_NONE)
# define INADDR_NONE 0xffffffff
# endif
# if !defined(__BEOS__) && defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1)
# if defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1)
typedef uint32_t in_addr_t;
# endif
@@ -98,10 +84,6 @@ typedef unsigned long in_addr_t;
# include <netdb.h>
#endif /* UNIX */
#ifdef __BEOS__
typedef int socklen_t;
#endif
#ifdef __HAIKU__
#define IPV6_V6ONLY 27
#endif
@@ -174,11 +156,7 @@ static inline bool SetNonBlocking(SOCKET d)
#else
int nonblocking = 1;
#endif
#if (defined(__BEOS__) && defined(BEOS_NET_SERVER))
return setsockopt(d, SOL_SOCKET, SO_NONBLOCK, &nonblocking, sizeof(nonblocking)) == 0;
#else
return ioctlsocket(d, FIONBIO, &nonblocking) == 0;
#endif
}
/**
@@ -189,13 +167,9 @@ static inline bool SetNonBlocking(SOCKET d)
static inline bool SetNoDelay(SOCKET d)
{
/* XXX should this be done at all? */
#if !defined(BEOS_NET_SERVER) /* not implemented on BeOS net_server */
int b = 1;
/* The (const char*) cast is needed for windows */
return setsockopt(d, IPPROTO_TCP, TCP_NODELAY, (const char*)&b, sizeof(b)) == 0;
#else
return true;
#endif
}
/* Make sure these structures have the size we expect them to be */

View File

@@ -94,7 +94,6 @@ void NetworkUDPSocketHandler::SendPacket(Packet *p, NetworkAddress *recv, bool a
p->PrepareToSend();
#ifndef BEOS_NET_SERVER /* will work around this, some day; maybe. */
if (broadcast) {
/* Enable broadcast */
unsigned long val = 1;
@@ -102,7 +101,6 @@ void NetworkUDPSocketHandler::SendPacket(Packet *p, NetworkAddress *recv, bool a
DEBUG(net, 1, "[udp] setting broadcast failed with: %i", GET_LAST_ERROR());
}
}
#endif
/* Send the buffer */
int res = sendto(s->second, (const char*)p->buffer, p->size, 0, (const struct sockaddr *)send.GetAddress(), send.GetAddressLength());