Mesa (mesa_7_4_branch): mesa: fixes for building on Haiku
Brian Paul
brianp at kemper.freedesktop.org
Mon Feb 23 15:16:19 UTC 2009
Module: Mesa
Branch: mesa_7_4_branch
Commit: 06295ddbdd6e305121f3616e8ae71841ef189a8e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=06295ddbdd6e305121f3616e8ae71841ef189a8e
Author: Brian Paul <brianp at vmware.com>
Date: Mon Feb 23 08:15:43 2009 -0700
mesa: fixes for building on Haiku
(cherry picked from master, commit 41172c04306098ab9ecba8b48d7be47c3911a662)
Conflicts:
src/mesa/main/dlopen.c
---
src/mesa/glapi/glthread.h | 12 ++++++++++++
src/mesa/main/dlopen.c | 9 +++++++++
src/mesa/main/imports.h | 3 ++-
src/mesa/x86/gen_matypes.c | 4 ++--
4 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h
index 27ccd2e..8594a90 100644
--- a/src/mesa/glapi/glthread.h
+++ b/src/mesa/glapi/glthread.h
@@ -225,9 +225,21 @@ typedef xmutex_rec _glthread_Mutex;
*/
#ifdef BEOS_THREADS
+/* Problem with OS.h and this file on haiku */
+#ifndef __HAIKU__
#include <kernel/OS.h>
+#endif
+
#include <support/TLS.h>
+/* The only two typedefs required here
+ * this is cause of the OS.h problem
+ */
+#ifdef __HAIKU__
+typedef int32 thread_id;
+typedef int32 sem_id;
+#endif
+
typedef struct {
int32 key;
int initMagic;
diff --git a/src/mesa/main/dlopen.c b/src/mesa/main/dlopen.c
index becef81..d9d1152 100644
--- a/src/mesa/main/dlopen.c
+++ b/src/mesa/main/dlopen.c
@@ -36,6 +36,15 @@
#include <dlfcn.h>
#endif
+#if defined(_WIN32)
+#include <windows.h>
+#endif
+
+#if defined(__HAIKU__)
+/* for NULL */
+#include <stdio.h>
+#endif
+
/**
* Wrapper for dlopen().
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 13b571d..d71d59c 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -325,7 +325,8 @@ static INLINE int iround(float f)
}
#define IROUND(x) iround(x)
#elif defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) && \
- (!defined(__BEOS__) || (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)))
+ (!(defined(__BEOS__) || defined(__HAIKU__)) || \
+ (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)))
static INLINE int iround(float f)
{
int r;
diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c
index afb4b11..8c690b4 100644
--- a/src/mesa/x86/gen_matypes.c
+++ b/src/mesa/x86/gen_matypes.c
@@ -61,7 +61,7 @@ do { \
printf( "\n" ); \
} while (0)
-#if defined(__BEOS__) || defined(_LP64)
+#if defined(__BEOS__) || defined(__HAIKU__) || defined(_LP64)
#define OFFSET( s, t, m ) \
printf( "#define %s\t%ld\n", s, offsetof( t, m ) );
#else
@@ -69,7 +69,7 @@ do { \
printf( "#define %s\t%d\n", s, offsetof( t, m ) );
#endif
-#if defined(__BEOS__) || defined(_LP64)
+#if defined(__BEOS__) || defined(__HAIKU__) || defined(_LP64)
#define SIZEOF( s, t ) \
printf( "#define %s\t%ld\n", s, sizeof(t) );
#else
More information about the mesa-commit
mailing list