summaryrefslogtreecommitdiff
path: root/src/network/core/os_abstraction.h
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/core/os_abstraction.h
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/core/os_abstraction.h')
-rw-r--r--src/network/core/os_abstraction.h58
1 files changed, 16 insertions, 42 deletions
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 */