From c76e7b2b9fec72b2e56c9664ed05052100174d80 Mon Sep 17 00:00:00 2001
From: Ken Mays <kmays2000@gmail.com>
Date: Fri, 4 Jan 2019 19:45:50 +0100
Subject: Fix DT_DIR handling under Haiku


diff --git a/sys/simsys.cc b/sys/simsys.cc
index 4541b20..30a2af5 100644
--- a/sys/simsys.cc
+++ b/sys/simsys.cc
@@ -476,7 +476,9 @@ const char *dr_query_fontpath(int which)
 			// look for subdirectories
 			struct dirent *entry;
 			while( (entry = readdir( dir )) ) {
+#ifndef __HAIKU__
 				if( entry->d_type == DT_DIR ) {
+#endif
 					if( ((strcmp( entry->d_name, "." )) != 0) && ((strcmp( entry->d_name, ".." )) != 0) ) {
 						j++;
 						if( subdir_offset < j ) {
@@ -489,7 +491,9 @@ const char *dr_query_fontpath(int which)
 							return buffer;
 						}
 					}
+#ifndef __HAIKU__
 				}
+#endif
 			}
 			// last return parent folder
 			closedir( dir );
-- 
2.30.2


From 6f8dea69fb6267f0809b5a7de44210cc35dedcb7 Mon Sep 17 00:00:00 2001
From: Ken Mays <kmays2000@gmail.com>
Date: Fri, 4 Jan 2019 19:45:50 +0100
Subject: Fix UINT type handling under Haiku


diff --git a/simtypes.h b/simtypes.h
index 8ca5bf5..15bff0a 100644
--- a/simtypes.h
+++ b/simtypes.h
@@ -9,6 +9,7 @@
 
 #include "utils/for.h"
 #include <limits.h>
+#include <OS.h>
 
 #ifndef PATH_MAX
 #ifdef MAX_PATH
@@ -169,19 +170,25 @@ typedef unsigned short      uint16;
 #ifndef __BEOS__
 typedef   signed int        sint32;
 #ifndef NO_UINT32_TYPES
+#ifndef __HAIKU__
 typedef unsigned int        uint32;
 #endif
+#endif
 #else
 // BeOS: int!=long (even though both 32 bit)
 typedef   signed long       sint32;
 #ifndef NO_UINT32_TYPES
+#ifndef __HAIKU__
 typedef unsigned long       uint32;
 #endif
 #endif
+#endif
 typedef   signed long long  sint64;
 #ifndef NO_UINT64_TYPES
+#ifndef __HAIKU__
 typedef unsigned long long  uint64;
 #endif
+#endif
 #ifdef _MSC_VER
 #	define GCC_PACKED
 #	define GCC_ALIGN(a)
-- 
2.30.2


From f6d08a8374f251df352062c18b49431199e029cc Mon Sep 17 00:00:00 2001
From: Ken Mays <kmays2000@gmail.com>
Date: Fri, 4 Jan 2019 19:45:50 +0100
Subject: Fix save game issue on Haiku


diff --git a/dataobj/loadsave.cc b/dataobj/loadsave.cc
index 5772ae2..84f0143 100644
--- a/dataobj/loadsave.cc
+++ b/dataobj/loadsave.cc
@@ -31,7 +31,11 @@
 
 #define INVALID_RDWR_ID (-1)
 
+#ifdef __HAIKU__
+#undef MULTI_THREAD
+#else
 //#undef MULTI_THREAD
+#endif
 
 // buffer size for read/write - bzip2 gains up to 8M for non-threaded, 1M for threaded. binary, zipped ok with 256K or smaller.
 #define LS_BUF_SIZE (1 << 20) // 1 MiB
-- 
2.30.2

