summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2019-03-04 19:46:11 +0100
committerPatric Stout <truebrain@openttd.org>2019-03-05 22:03:00 +0100
commitf58db44ff22c07af984b2d513d24524594f660a7 (patch)
tree1909be4c44f287495413b96c3298c15cc1775081 /src/network
parentad30d04b5eddccea1c547a050b1afc225d277af4 (diff)
downloadopenttd-f58db44ff22c07af984b2d513d24524594f660a7.tar.xz
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.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/host.cpp2
-rw-r--r--src/network/core/os_abstraction.h58
-rw-r--r--src/network/core/udp.cpp2
3 files changed, 17 insertions, 45 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp
index 216839032..c2faf4c8b 100644
--- a/src/network/core/host.cpp
+++ b/src/network/core/host.cpp
@@ -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);
diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h
index 187e2584c..084f763c2 100644
--- a/src/network/core/os_abstraction.h
+++ b/src/network/core/os_abstraction.h
@@ -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 */
-
-# if !defined(__BEOS__) && defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1)
+# include <ifaddrs.h>
+# define HAVE_GETIFADDRS
+# endif
+# if !defined(INADDR_NONE)
+# define INADDR_NONE 0xffffffff
+# endif
+
+# 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 */
diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp
index d2dc15d42..1f34d15b0 100644
--- a/src/network/core/udp.cpp
+++ b/src/network/core/udp.cpp
@@ -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());