From 9ee6999667c72855787006a5ed06599850706ca4 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Fri, 11 Apr 2014 15:46:09 +0400
Subject: settimeofday is not implemented on Haiku


diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index 0edb58c..2b8d365 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -105,6 +105,14 @@ int net_time_usage(struct net_context *c, int argc, const char **argv)
 	return -1;
 }
 
+#ifdef __HAIKU__
+int settimeofday(struct timeval *tv, struct timezone *tz)
+{
+set_real_time_clock(tv->tv_sec);
+return(0);
+}
+#endif //__HAIKU__
+
 /* try to set the system clock */
 static int net_time_set(struct net_context *c, int argc, const char **argv)
 {
-- 
2.28.0


From bd80153bb94edcc829723bd09a687c723742cbf0 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 11 Oct 2017 20:20:42 +0200
Subject: Haiku has only a typedef for uchar.


diff --git a/source3/include/includes.h b/source3/include/includes.h
index 1beca26..7ef5d1f 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -196,7 +196,7 @@ typedef sig_atomic_t SIG_ATOMIC_T;
 typedef sig_atomic_t volatile SIG_ATOMIC_T;
 #endif
 
-#ifndef uchar
+#if !defined(uchar)  && !defined(__HAIKU__)
 #define uchar unsigned char
 #endif
 
-- 
2.28.0


From a0bae36ef6953ae4126bdf7ad99c9b57ab2495bf Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sun, 22 Nov 2020 15:39:52 +0000
Subject: Fix conflicting int types for 32bit Haiku


diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index 926ccc7..5bd6582 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -65,6 +65,9 @@
 #endif
 
 /* Decimal notation.  */
+#if defined(__HAIKU__)
+#include <SupportDefs.h>
+#else
 #ifndef PRId8
 # define PRId8		"d"
 #endif
@@ -103,6 +106,7 @@
 #ifndef PRIu64
 # define PRIu64		__PRI64_PREFIX "u"
 #endif
+#endif
 
 #ifdef HAVE_STRING_H
 #include <string.h>
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 7ef5d1f..bb84fca 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -209,6 +209,11 @@ typedef sig_atomic_t volatile SIG_ATOMIC_T;
    as signed and unsigned int will work.
 */
 
+#if defined(__HAIKU__)
+#include <SupportDefs.h>
+#include <ByteOrder.h>
+#endif
+
 #ifndef uint8
 #define uint8 uint8_t
 #endif
-- 
2.28.0

