summaryrefslogtreecommitdiff
path: root/src/network/core/host.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-21 18:36:33 +0000
committerrubidium <rubidium@openttd.org>2009-09-21 18:36:33 +0000
commit01ab1c60011eb1b9cef03fac73da4b71410f1460 (patch)
treedb7eec7f2444b6f5381730c56692700a22551f77 /src/network/core/host.cpp
parent3dd202ba1c15bb5e1bac3ab21eed7f63435a88bb (diff)
downloadopenttd-01ab1c60011eb1b9cef03fac73da4b71410f1460.tar.xz
(svn r17606) -Add: initial support for Haiku; a dedicated server with zlib and libpng compiles and links (for me). Something's fishy with the network so it doesn't actually work (yet)
Diffstat (limited to 'src/network/core/host.cpp')
-rw-r--r--src/network/core/host.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp
index ee9fcfe8f..d622e2e8c 100644
--- a/src/network/core/host.cpp
+++ b/src/network/core/host.cpp
@@ -30,9 +30,9 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // PS
{
}
-#elif defined(BEOS_NET_SERVER) /* doesn't have neither getifaddrs or net/if.h */
+#elif defined(BEOS_NET_SERVER) || defined(__HAIKU__) /* doesn't have neither getifaddrs or net/if.h */
/* Based on Andrew Bachmann's netstat+.c. Big thanks to him! */
-int _netstat(int fd, char **output, int verbose);
+extern "C" int _netstat(int fd, char **output, int verbose);
int seek_past_header(char **pos, const char *header)
{
@@ -63,9 +63,9 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // BE
char **output = &output_pointer;
if (seek_past_header(output, "IP Interfaces:") == B_OK) {
for (;;) {
- uint32 n, fields, read;
+ uint32 n;
+ int fields, read;
uint8 i1, i2, i3, i4, j1, j2, j3, j4;
- struct in_addr inaddr;
uint32 ip;
uint32 netmask;
@@ -85,7 +85,6 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // BE
((sockaddr_in*)&address)->sin_addr.s_addr = htonl(ip | ~netmask);
NetworkAddress addr(address, sizeof(sockaddr));
if (!broadcast->Contains(addr)) *broadcast->Append() = addr;
- index++;
}
if (read < 0) {
break;