summaryrefslogtreecommitdiff
path: root/network_core.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-23 14:46:16 +0000
committertruelight <truelight@openttd.org>2004-12-23 14:46:16 +0000
commitdfc5fdbb9287391bd42c1ed0145faf8607e8b04b (patch)
tree70df1e5fa1346ddc8214906f90ce7ff391e41e98 /network_core.h
parent3fa05f42b2f0cda6f62ab7191e96261106340e44 (diff)
downloadopenttd-dfc5fdbb9287391bd42c1ed0145faf8607e8b04b.tar.xz
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
Works fine, beside some minor stuff: - Network is not working yet - Keyboard is not working - No MIDI support - 'A few file selector bugs involving drives'
Diffstat (limited to 'network_core.h')
-rw-r--r--network_core.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/network_core.h b/network_core.h
index 4eaea2d81..49c290eb1 100644
--- a/network_core.h
+++ b/network_core.h
@@ -66,6 +66,32 @@ typedef struct ifreq IFREQ;
# include <netdb.h>
#endif // UNIX
+// OS/2 stuff
+#if defined(__OS2__)
+# define SOCKET int
+# define INVALID_SOCKET -1
+typedef struct ifreq IFREQ;
+# define ioctlsocket ioctl
+# define closesocket close
+# define GET_LAST_ERROR() (errno)
+
+// Includes needed for OS/2 systems
+# include <types.h>
+# include <unistd.h>
+# include <sys/ioctl.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <netinet/tcp.h>
+# include <arpa/inet.h>
+# include <net/if.h>
+# include <errno.h>
+# include <sys/time.h>
+# include <netdb.h>
+# include <nerrno.h>
+
+typedef unsigned long in_addr_t;
+#endif // OS/2
+
// MorphOS and Amiga stuff
#if defined(__MORPHOS__) || defined(__AMIGA__)
# include <exec/types.h>