]> Nishi Git Mirror - tewi.git/commitdiff
trying to add haiku support
authorNishi <nishi@nishi.boats>
Thu, 19 Sep 2024 12:47:40 +0000 (12:47 +0000)
committerNishi <nishi@nishi.boats>
Thu, 19 Sep 2024 12:47:40 +0000 (12:47 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@82 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c

index d0b4963edf9bc3178136597f5a97d42aaf0ddaf0..eee36e1fa9bea1733f28154a220ccbe759194147 100644 (file)
@@ -131,7 +131,13 @@ int tw_server_init(void) {
                memset(&addresses[i], 0, sizeof(addresses[i]));
 #ifdef NO_IPV6
                addresses[i].sin_family = AF_INET;
+#ifdef __HAIKU__
+               if((addresses[i].sin_addr.s_addr = gethostaddr()) == -1){
+                       addresses[i].sin_addr.s_addr = INADDR_ANY;
+               }
+#else
                addresses[i].sin_addr.s_addr = INADDR_ANY;
+#endif
                addresses[i].sin_port = htons(config.ports[i]);
 #else
                addresses[i].sin6_family = AF_INET6;