From d831a96dce022c30e971f51449bb5dd56e3b1a8e Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 19 Jan 2019 09:26:56 +0100
Subject: fix build


diff --git a/gsoap/stdsoap2.cpp b/gsoap/stdsoap2.cpp
index 7382f9f..6ddadcc 100644
--- a/gsoap/stdsoap2.cpp
+++ b/gsoap/stdsoap2.cpp
@@ -18267,7 +18267,7 @@ time_t
 SOAP_FMAC2
 soap_timegm(struct tm *T)
 {
-#if defined(HAVE_TIMEGM)
+#if defined(HAVE_TIMEGM) && !defined(__HAIKU__)
   return timegm(T);
 #else
   time_t t, g, z;
diff --git a/gsoap/stdsoap2.h b/gsoap/stdsoap2.h
index f4df891..faaef1a 100644
--- a/gsoap/stdsoap2.h
+++ b/gsoap/stdsoap2.h
@@ -711,6 +711,30 @@ extern intmax_t __strtoull(const char*, char**, int);
 # endif
 #endif
 
+#if defined(__HAIKU__)
+#  define LC_ALL_MASK      0
+#  define LC_NUMERIC_MASK  0
+#  define LC_MESSAGES_MASK 0
+#  define LC_GLOBAL_LOCALE ((locale_t)(uintptr_t)1)
+typedef void *locale_t;
+
+static inline void freelocale(locale_t loc)
+{
+    (void)loc;
+}
+static inline locale_t newlocale(int mask, const char * locale, locale_t base)
+{
+    (void)mask; (void)locale; (void)base;
+    return NULL;
+}
+
+static inline locale_t uselocale(locale_t loc)
+{
+    (void)loc;
+    return NULL;
+}
+#endif //Haiku
+
 #ifdef WITH_C_LOCALE
 # include <locale.h>
 # if defined(WIN32) && !defined(CYGWIN)
@@ -995,7 +1019,7 @@ extern "C" {
 # endif
 #elif defined(SOCKLEN_T)
 # define SOAP_SOCKLEN_T SOCKLEN_T
-#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN) || defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD) || defined(__QNX__) || defined(QNX) || defined(OS390) || defined(__ANDROID__) || defined(_XOPEN_SOURCE)
+#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN) || defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD) || defined(__QNX__) || defined(QNX) || defined(OS390) || defined(__ANDROID__) || defined(_XOPEN_SOURCE) || defined(__HAIKU__)
 # define SOAP_SOCKLEN_T socklen_t
 #elif defined(IRIX) || defined(WIN32) || defined(__APPLE__) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS)
 # define SOAP_SOCKLEN_T int
-- 
2.19.1


From cc048fe14f4bb3a19e6206b238d20931328c9206 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 19 Jan 2019 19:00:59 +0100
Subject: add Haiku to platforms, use libnetwork and libcrypto


diff --git a/configure.ac b/configure.ac
index 90a5090..54a725d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,6 +86,10 @@ case "${host}" in
 	*-nto-qnx)	platform=QNX
 			SAMPLE_EXTRA_LIBS="-lsocket -lm"
 			;;
+        *-*-haiku*)     platform=HAIKU
+        	SAMPLE_EXTRA_LIBS="-lnetwork -lcrypto"
+        	WSDL2H_EXTRA_LIBS="-lnetwork"
+        	;;
         *)              platform=UNKNOWN ;;
 esac
 
-- 
2.19.1

