From 076fd57c597d56cf064237e3fb487cbff02565b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Sat, 26 Jul 2014 18:14:25 +0200
Subject: Just use int32 for atomics on Haiku now

We dropped the volatile requirement.

diff --git a/system/AtomicCounter.h b/system/AtomicCounter.h
index 49394e3..d16c170 100644
--- a/system/AtomicCounter.h
+++ b/system/AtomicCounter.h
@@ -202,7 +202,7 @@ private:
 #elif defined(__APPLE__)
    volatile int32_t _count;
 #elif defined(__BEOS__)
-# if defined(B_BEOS_VERSION_5)
+# if defined(B_BEOS_VERSION_5) && !defined(__HAIKU__)
    vint32 _count;
 # else
    int32 _count;
-- 
1.8.3.4


From 81eeba21d85ff5279e2166a3a489dbecbf255951 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 13 Jun 2015 10:32:08 +0000
Subject: Haiku x86_64 patch


diff --git a/util/FilePathInfo.cpp b/util/FilePathInfo.cpp
index 2037bb8..4af598b 100644
--- a/util/FilePathInfo.cpp
+++ b/util/FilePathInfo.cpp
@@ -59,7 +59,7 @@ void FilePathInfo :: SetFilePath(const char * optFilePath)
          CloseHandle(hFile);
       }
 #else
-# if defined(MUSCLE_64_BIT_PLATFORM) && !defined(__APPLE__) && !defined(__CYGWIN__)
+# if defined(MUSCLE_64_BIT_PLATFORM) && !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__HAIKU__)
       struct stat64 statInfo;
       if (stat64(optFilePath, &statInfo) == 0)
 # else
@@ -72,7 +72,7 @@ void FilePathInfo :: SetFilePath(const char * optFilePath)
          if (S_ISREG(statInfo.st_mode)) _flags |= (1L<<FPI_FLAG_ISREGULARFILE);
 
          _size = statInfo.st_size;
-# if defined(MUSCLE_64_BIT_PLATFORM) && !defined(_POSIX_SOURCE) && !defined(__CYGWIN__)
+# if defined(MUSCLE_64_BIT_PLATFORM) && !defined(_POSIX_SOURCE) && !defined(__CYGWIN__) && !defined(__HAIKU__)
          _atime = InternalizeTimeSpec(statInfo.st_atimespec);
 #  if !defined(__APPLE__) || (__DARWIN_64_BIT_INO_T == 1)
          _ctime = InternalizeTimeSpec(statInfo.st_birthtimespec);
-- 
1.8.3.4

From e4023c881502bcbcce5b86563e1a2278f4e6db64 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Thu, 2 Nov 2017 23:53:50 +0100
Subject: Build fix


diff --git a/system/SetupSystem.cpp b/system/SetupSystem.cpp
index c7e9274..ccaea3b 100644
--- a/system/SetupSystem.cpp
+++ b/system/SetupSystem.cpp
@@ -649,7 +649,7 @@ static inline uint32 get_tbu() {uint32 tbu; asm volatile("mftbu %0" : "=r" (tbu)
 static uint64 GetRunTime64Aux()
 {
 #if defined(__BEOS__) || defined(__HAIKU__)
-   return return system_time();
+   return system_time();
 #elif defined(TARGET_PLATFORM_XENOMAI) && !defined(MUSCLE_AVOID_XENOMAI)
    return rt_timer_tsc2ns(rt_timer_tsc())/1000;
 #elif defined(WIN32)

-- 
2.14.2
