From 71ea76c0f3842a048e6f004d291176a1399ca9f5 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 5 Sep 2014 15:37:36 +0000
Subject: Haiku patch


diff --git a/Makefile b/Makefile
index b67b3e8..181a9ef 100644
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,9 @@ else
   SONAMEFLAGS=-Wl,-soname,$(JNISHAREDLIB)
 endif
 endif
+ifeq ($(OS), Haiku)
+LDFLAGS += -lnetwork
+endif
 
 HEADERS = natpmp.h
 
diff --git a/getgateway.c b/getgateway.c
index 45c6e6f..dd73356 100644
--- a/getgateway.c
+++ b/getgateway.c
@@ -67,7 +67,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #undef USE_SYSCTL_NET_ROUTE
 #endif
 
-#if !defined(USE_PROC_NET_ROUTE) && !defined(USE_SOCKET_ROUTE) && !defined(USE_SYSCTL_NET_ROUTE)
+#if !defined(USE_PROC_NET_ROUTE) && !defined(USE_SOCKET_ROUTE) && !defined(USE_SYSCTL_NET_ROUTE) && !defined(__HAIKU__)
 int getdefaultgateway(in_addr_t * addr)
 {
 	return -1;
-- 
1.8.3.4

