summaryrefslogtreecommitdiff
path: root/src/cairo-mutex-private.h
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2007-05-01 00:41:07 -0400
committerBehdad Esfahbod <behdad@behdad.org>2007-05-01 00:41:47 -0400
commitf7cdbd385a02d023e35357cd27dcc165ada667f2 (patch)
tree25ca98d3522bc4cd4907fc669428eafa198822a7 /src/cairo-mutex-private.h
parent6de0f2d15775a451ead2cc3e80530b7dc6b321a3 (diff)
[cairo-mutex-private.h] Move implementation-specific parts to cairo-mutex-type-private.h
This fixes the problem reported by Dave Yeo that boilerplate wasn't building: In file included from ../src/cairo-scaled-font-private.h:44, from cairo-boilerplate.c:65: ../src/cairo-mutex-private.h:183: error: syntax error before "extern" ../src/cairo-mutex-private.h:184: error: syntax error before "void" ../src/cairo-mutex-private.h:185: error: syntax error before "void" make[3]: *** [cairo-boilerplate.lo] Error 1
Diffstat (limited to 'src/cairo-mutex-private.h')
-rw-r--r--src/cairo-mutex-private.h81
1 files changed, 2 insertions, 79 deletions
diff --git a/src/cairo-mutex-private.h b/src/cairo-mutex-private.h
index 28c315d2a..67a52b839 100644
--- a/src/cairo-mutex-private.h
+++ b/src/cairo-mutex-private.h
@@ -47,86 +47,9 @@
#include <cairo-features.h>
-CAIRO_BEGIN_DECLS
-
-
-/* A fully qualified no-operation statement */
-#define CAIRO_MUTEX_NOOP do {/*no-op*/} while (0)
-
-
-
-#if CAIRO_NO_MUTEX
-
-/* A poor man's mutex */
-
- typedef int cairo_mutex_t;
-
-# define CAIRO_MUTEX_INITIALIZE() CAIRO_MUTEX_NOOP
-# define CAIRO_MUTEX_LOCK(name) do { while (name) ; (name) = 1; } while (0)
-# define CAIRO_MUTEX_UNLOCK(name) (name) = 0
-# define CAIRO_MUTEX_NIL_INITIALIZER 0
-
-#elif HAVE_PTHREAD_H /*******************************************************/
-
-# include <pthread.h>
-
- typedef pthread_mutex_t cairo_mutex_t;
-
-# define CAIRO_MUTEX_INITIALIZE() CAIRO_MUTEX_NOOP
-# define CAIRO_MUTEX_LOCK(name) pthread_mutex_lock (&(name))
-# define CAIRO_MUTEX_UNLOCK(name) pthread_mutex_unlock (&(name))
-# define CAIRO_MUTEX_FINI(mutex) pthread_mutex_destroy (mutex)
-# define CAIRO_MUTEX_NIL_INITIALIZER PTHREAD_MUTEX_INITIALIZER
-
-#elif HAVE_WINDOWS_H /*******************************************************/
-
-# include <windows.h>
-
- typedef CRITICAL_SECTION cairo_mutex_t;
-
-# define CAIRO_MUTEX_LOCK(name) EnterCriticalSection (&(name))
-# define CAIRO_MUTEX_UNLOCK(name) LeaveCriticalSection (&(name))
-# define CAIRO_MUTEX_INIT(mutex) InitializeCriticalSection (mutex)
-# define CAIRO_MUTEX_FINI(mutex) DeleteCriticalSection (mutex)
-# define CAIRO_MUTEX_NIL_INITIALIZER { NULL, 0, 0, NULL, NULL, 0 }
-
-#elif defined __OS2__ /******************************************************/
-
-# define INCL_BASE
-# define INCL_PM
-# include <os2.h>
-
- typedef HMTX cairo_mutex_t;
-
-# define CAIRO_MUTEX_LOCK(name) DosRequestMutexSem(name, SEM_INDEFINITE_WAIT)
-# define CAIRO_MUTEX_UNLOCK(name) DosReleaseMutexSem(name)
-# define CAIRO_MUTEX_INIT(mutex) DosCreateMutexSem (NULL, mutex, 0L, FALSE)
-# define CAIRO_MUTEX_FINI(mutex) do { \
- if (0 != (mutex)) { \
- DosCloseMutexSem (*(mutex)); \
- (*(mutex)) = 0; \
- } \
-} while (0)
-# define CAIRO_MUTEX_NIL_INITIALIZER 0
-
-#elif CAIRO_HAS_BEOS_SURFACE /***********************************************/
-
- typedef BLocker* cairo_mutex_t;
-
-# define CAIRO_MUTEX_LOCK(name) (name)->Lock()
-# define CAIRO_MUTEX_UNLOCK(name) (name)->Unlock()
-# define CAIRO_MUTEX_INIT(mutex) (*(mutex)) = new BLocker()
-# define CAIRO_MUTEX_FINI(mutex) delete (*(mutex))
-# define CAIRO_MUTEX_NIL_INITIALIZER NULL
-
-#else /**********************************************************************/
-
-# error "XXX: No mutex implementation found. Define CAIRO_NO_MUTEX to 1" \
- " to compile cairo without thread-safety support."
-
-#endif
-
+#include "cairo-mutex-type-private.h"
+CAIRO_BEGIN_DECLS
#ifndef CAIRO_MUTEX_DECLARE
#define CAIRO_MUTEX_DECLARE(name) extern cairo_mutex_t name;