From 7637d9ba681440ced17b3ff03ce34fedf311e7f5 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Thu, 28 Jan 2010 01:29:34 +0100 Subject: [PATCH] Added experimental Haiku OS support. It compiles and it runs with some minor glitches. --- GNUmakefile | 11 +++++++++-- src/network/network.c | 3 +++ src/system.h | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index f9537a4..5683fe5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -17,15 +17,22 @@ STACK_PROTECT ?= NO ifeq ($(OS), Windows_NT) WINDOWS ?= YES +OPSYS ?= Windows +else +OPSYS ?= $(shell uname) endif -ifeq (SOLARIS,YES) +ifeq ($(OPSYS),SunOS) LDLIBS += -lsocket -lnsl endif +ifeq ($(OPSYS),Haiku) +LDLIBS += -lnetwork +endif + CFLAGS += -I./src/ -ifeq ($(WINDOWS),YES) +ifeq ($(OPSYS),Windows) USE_BIGENDIAN := NO LDLIBS += -lws2_32 UHUB_CONF_DIR ?= c:/uhub/ diff --git a/src/network/network.c b/src/network/network.c index 3bc4a4e..d276d8e 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -351,6 +351,9 @@ int net_accept(int fd, struct ip_addr_encap* ipaddr) { switch (net_error()) { +#if defined(__HAIKU__) + case ETIMEDOUT: +#endif #if defined(__linux__) case ENETDOWN: case EPROTO: diff --git a/src/system.h b/src/system.h index 11005c8..71de548 100644 --- a/src/system.h +++ b/src/system.h @@ -81,7 +81,9 @@ #include #include #define HAVE_STRNDUP +#ifndef __HAIKU__ #define HAVE_MEMMEM +#endif #define HAVE_GETRLIMIT #endif