From 7eb459b9e4b6ba5ecf3065a603285681f822cc53 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 26 Feb 2014 17:02:49 +0000
Subject: Haiku: adapt configure for x86_64

* don't hardcode arch/cpu.
* define _POSIX_C_SOURCE for memalign.

diff --git a/configure b/configure
index 2f11a10..59ed591 100755
--- a/configure
+++ b/configure
@@ -583,7 +583,7 @@ Haiku)
   sysconfdir="${prefix}/etc"
   bindir="${prefix}"
   confsuffix=""
-  CFLAGS="-fno-pic -march=prescott -mtune=core2 $CFLAGS"
+  CFLAGS="$CFLAGS -D_POSIX_C_SOURCE"
   QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS"
   LIBS="-lposix_error_mapper -lnetwork -lbe -lbsd -lgame -lmedia -lstdc++ $LIBS"
 ;;
-- 
1.8.3.4


From d5e0e5b00c84005d8685b5a76d611d1b39f61c06 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 26 Feb 2014 17:19:05 +0000
Subject: Haiku: don't hardcode types.


diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index a445506..f3927e2 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -55,24 +55,12 @@ these four paragraphs for those parts of this code that are retained.
 | to the same as `int'.
 *----------------------------------------------------------------------------*/
 typedef uint8_t flag;
-#ifndef __HAIKU__
 typedef uint8_t uint8;
 typedef int8_t int8;
 typedef unsigned int uint32;
 typedef signed int int32;
 typedef uint64_t uint64;
 typedef int64_t int64;
-#else
-// Haiku types
-typedef signed char int8;
-typedef unsigned char uint8;
-typedef short int16;
-typedef unsigned short uint16;
-typedef long int32;
-typedef unsigned long uint32;
-typedef long long int64;
-typedef unsigned long long uint64;
-#endif
 
 #define LIT64( a ) a##LL
 #define INLINE static inline
-- 
1.8.3.4


From 22229911497a93086ea5dff35683cf2f5ac63754 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 20 Apr 2014 12:59:07 +0200
Subject: Avoid redefinition of int32and uint32


diff --git a/include/haiku-include-before.h b/include/haiku-include-before.h
index 87cde55..4cdb25e 100644
--- a/include/haiku-include-before.h
+++ b/include/haiku-include-before.h
@@ -16,4 +16,7 @@
 #undef atomic_and
 #undef atomic_or
 
+#define int32 haiku_int32
+#define uint32 haiku_uint32
+
 #endif /* HAIKU_INCLUDE_BEFORE_H */
diff --git a/ui/haiku.cpp b/ui/haiku.cpp
index 7b6ce41..2106b82 100644
--- a/ui/haiku.cpp
+++ b/ui/haiku.cpp
@@ -57,6 +57,8 @@ static const uint32 kConsoleSelectEvent = 'cons';
 static const uint32 kShutdownRequest = 'shut';
 static const uint32 kInvalidationRequest = 'ival';
 
+#undef int32
+#undef uint32
 
 // QEMU C interface
 extern "C" {
@@ -84,6 +86,9 @@ static	void	haiku_refresh(DisplayChangeListener *dcl);
 		void	qemu_system_shutdown_request(void);
 };
 
+#define int32 haiku_int32
+#define uint32 haiku_uint32
+
 
 // Haiku keycode to scancode table
 static const uint8
-- 
1.8.3.4

