[Opensound-devel] [PATCH 2/5] beos: Fix Haiku build
Brought to you by:
compusonic
|
From: François R. <re...@fr...> - 2014-03-09 01:00:34
|
The spinlock type was changed to a struct so we now use an
initializer macro.
---
kernel/OS/BeOS/os_beos.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/kernel/OS/BeOS/os_beos.h b/kernel/OS/BeOS/os_beos.h
index 1e8f0b5..31fd27e 100644
--- a/kernel/OS/BeOS/os_beos.h
+++ b/kernel/OS/BeOS/os_beos.h
@@ -171,6 +171,11 @@ extern int oss_create_uio (uio_t * uiop, char *buf, size_t count, uio_rw_t rw,
* Mutexes
*/
+/* Haiku defines a specific initializer now, BeOS just used 0. */
+#ifndef B_INITIALIZE_SPINLOCK
+#define B_INITIALIZE_SPINLOCK(spinlock) do { *spinlock = 0; } while (false)
+#endif
+
#ifdef MUTEX_CHECKS
/* Debugging version */
struct _oss_mutex_t
@@ -198,7 +203,7 @@ extern void debug_mutex_exit (oss_mutex_t * mutex, char *file, int line, oss_nat
#define MUTEX_EXIT(mutex, flags) debug_mutex_exit(&mutex, __FILE__, __LINE__, NULL)
#else
typedef spinlock oss_mutex_t;
-#define MUTEX_INIT(osdev, mutex, hier) { mutex = 0; }
+#define MUTEX_INIT(osdev, mutex, hier) B_INITIALIZE_SPINLOCK(&(mutex))
#define MUTEX_CLEANUP(mutex)
#define MUTEX_ENTER_IRQDISABLE(mutex, flags) \
{ \
--
1.8.3.4
|