[cairo-mutex] Fix usage of CAIRO_MUTEX_DECLARE()

Previously cairo-mutex.c was abusing cairo-mutex-private.h by
defining CAIRO_MUTEX_DECLARE before including it, and
cairo-mutex-private.h was simply not overriding any available
CAIRO_MUTEX_DECLARE.  This is not the way it should be.
cairo-mutex.c should instead define CAIRO_MUTEX_DECLARE and
include cairo-mutex-list-private.h for itself.
This commit is contained in:
Behdad Esfahbod 2007-05-01 19:24:26 -04:00
parent 1a33e44aa5
commit e87a25dc7c
2 changed files with 6 additions and 7 deletions

View file

@ -62,9 +62,7 @@
CAIRO_BEGIN_DECLS
#ifndef CAIRO_MUTEX_DECLARE
#define CAIRO_MUTEX_DECLARE(mutex) extern cairo_mutex_t mutex;
#endif
#define CAIRO_MUTEX_DECLARE(mutex) extern cairo_mutex_t mutex
#include "cairo-mutex-list-private.h"
#undef CAIRO_MUTEX_DECLARE

View file

@ -31,11 +31,12 @@
* Mathias Hasselmann <mathias.hasselmann@gmx.de>
*/
#define CAIRO_MUTEX_DECLARE(mutex) \
cairo_mutex_t mutex = CAIRO_MUTEX_NIL_INITIALIZER;
#include "cairoint.h"
#define CAIRO_MUTEX_DECLARE(mutex) cairo_mutex_t mutex = CAIRO_MUTEX_NIL_INITIALIZER
#include "cairo-mutex-list-private.h"
#undef CAIRO_MUTEX_DECLARE
#if CAIRO_MUTEX_USE_GENERIC_INITIALIZATION
cairo_bool_t _cairo_mutex_initialized = FALSE;
@ -47,7 +48,7 @@ void _cairo_mutex_initialize (void)
_cairo_mutex_initialized = TRUE;
#define CAIRO_MUTEX_DECLARE(mutex) CAIRO_MUTEX_INIT (mutex);
#define CAIRO_MUTEX_DECLARE(mutex) CAIRO_MUTEX_INIT (mutex)
#include "cairo-mutex-list-private.h"
#undef CAIRO_MUTEX_DECLARE
}