mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 12:18:01 +02:00
Move declaration of cairo_mutex_t to cairo-mutex-private.h
This commit is contained in:
parent
9c52a9e7d8
commit
c4bd7cf6f8
10 changed files with 49 additions and 54 deletions
|
|
@ -39,7 +39,6 @@
|
|||
*/
|
||||
|
||||
#include "cairoint.h"
|
||||
#include "cairo-mutex-private.h"
|
||||
|
||||
/* Forward declare so we can use it as an arbitrary backend for
|
||||
* _cairo_font_face_nil.
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@
|
|||
#include <float.h>
|
||||
|
||||
#include "cairo-ft-private.h"
|
||||
#include "cairo-mutex-private.h"
|
||||
|
||||
#include <fontconfig/fontconfig.h>
|
||||
#include <fontconfig/fcfreetype.h>
|
||||
|
|
|
|||
|
|
@ -40,9 +40,13 @@
|
|||
#ifndef CAIRO_MUTEX_PRIVATE_H
|
||||
#define CAIRO_MUTEX_PRIVATE_H
|
||||
|
||||
#include "cairoint.h"
|
||||
CAIRO_BEGIN_DECLS
|
||||
|
||||
#if HAVE_PTHREAD_H
|
||||
#if HAVE_PTHREAD_H /*********************************************************/
|
||||
|
||||
# include <pthread.h>
|
||||
|
||||
typedef pthread_mutex_t cairo_mutex_t;
|
||||
|
||||
# define CAIRO_MUTEX_INITIALIZE() /* no-op */
|
||||
# define CAIRO_MUTEX_LOCK(name) pthread_mutex_lock (&name)
|
||||
|
|
@ -54,7 +58,23 @@
|
|||
# define CAIRO_MUTEX_FINI(mutex) pthread_mutex_destroy (mutex)
|
||||
# define CAIRO_MUTEX_NIL_INITIALIZER PTHREAD_MUTEX_INITIALIZER
|
||||
|
||||
#elif defined CAIRO_HAS_WIN32_SURFACE
|
||||
#elif defined CAIRO_HAS_WIN32_SURFACE /**************************************/
|
||||
|
||||
/* We require Windows 2000 features. Although we don't use them here, things
|
||||
* should still work if this header file ends up being the one to include
|
||||
* windows.h into a source file, so: */
|
||||
# if !defined(WINVER) || (WINVER < 0x0500)
|
||||
# define WINVER 0x0500
|
||||
# endif
|
||||
|
||||
# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
|
||||
typedef CRITICAL_SECTION cairo_mutex_t;
|
||||
|
||||
# define CAIRO_MUTEX_LOCK(name) EnterCriticalSection (&name)
|
||||
# define CAIRO_MUTEX_UNLOCK(name) LeaveCriticalSection (&name)
|
||||
|
|
@ -62,7 +82,13 @@
|
|||
# define CAIRO_MUTEX_FINI(mutex) DeleteCriticalSection (mutex)
|
||||
# define CAIRO_MUTEX_NIL_INITIALIZER { NULL, 0, 0, NULL, NULL, 0 }
|
||||
|
||||
#elif defined __OS2__
|
||||
#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)
|
||||
|
|
@ -75,10 +101,12 @@
|
|||
} while (0)
|
||||
# define CAIRO_MUTEX_NIL_INITIALIZER 0
|
||||
|
||||
#elif defined CAIRO_HAS_BEOS_SURFACE
|
||||
#elif defined CAIRO_HAS_BEOS_SURFACE /***************************************/
|
||||
|
||||
cairo_private void _cairo_beos_lock(cairo_mutex_t*);
|
||||
cairo_private void _cairo_beos_unlock(cairo_mutex_t*);
|
||||
typedef void* cairo_mutex_t;
|
||||
|
||||
cairo_private void _cairo_beos_lock(cairo_mutex_t*);
|
||||
cairo_private void _cairo_beos_unlock(cairo_mutex_t*);
|
||||
|
||||
/* the real initialization takes place in a global constructor */
|
||||
# define CAIRO_MUTEX_LOCK(name) _cairo_beos_lock (&name)
|
||||
|
|
@ -92,12 +120,12 @@ cairo_private void _cairo_beos_unlock(cairo_mutex_t*);
|
|||
# define CAIRO_MUTEX_FINI(mutex) ???
|
||||
# define CAIRO_MUTEX_NIL_INITIALIZER {}
|
||||
|
||||
#else
|
||||
#else /**********************************************************************/
|
||||
|
||||
# define CAIRO_MUTEX_LOCK(name)
|
||||
# define CAIRO_MUTEX_UNLOCK(name)
|
||||
|
||||
#endif
|
||||
#endif /********************************************************************/
|
||||
|
||||
#ifndef CAIRO_MUTEX_DECLARE
|
||||
#define CAIRO_MUTEX_DECLARE(name) extern cairo_mutex_t name;
|
||||
|
|
@ -120,4 +148,11 @@ cairo_private void _cairo_mutex_initialize(void);
|
|||
|
||||
#endif
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,10 @@
|
|||
* Mathias Hasselmann <mathias.hasselmann@gmx.de>
|
||||
*/
|
||||
|
||||
#define CAIRO_MUTEX_DECLARE(name) cairo_mutex_t name = CAIRO_MUTEX_NIL_INITIALIZER;
|
||||
#include "cairo-mutex-private.h"
|
||||
#define CAIRO_MUTEX_DECLARE(name) \
|
||||
cairo_mutex_t name = CAIRO_MUTEX_NIL_INITIALIZER;
|
||||
|
||||
#include "cairoint.h"
|
||||
|
||||
#if !HAVE_PTHREAD_H
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@
|
|||
#include "cairo-paginated-surface-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-mutex-private.h"
|
||||
|
||||
typedef struct _cairo_paginated_surface {
|
||||
cairo_surface_t base;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
*/
|
||||
|
||||
#include "cairoint.h"
|
||||
#include "cairo-mutex-private.h"
|
||||
|
||||
const cairo_solid_pattern_t cairo_pattern_nil = {
|
||||
{ CAIRO_PATTERN_TYPE_SOLID, /* type */
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
*/
|
||||
|
||||
#include "cairoint.h"
|
||||
#include "cairo-mutex-private.h"
|
||||
#include "cairo-scaled-font-test.h"
|
||||
|
||||
static cairo_bool_t
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
|
||||
#include "cairoint.h"
|
||||
#include "cairo-surface-fallback-private.h"
|
||||
#include "cairo-mutex-private.h"
|
||||
#include "cairo-clip-private.h"
|
||||
|
||||
#define DEFINE_NIL_SURFACE(status, name) \
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "cairo-xlib-private.h"
|
||||
#include "cairo-mutex-private.h"
|
||||
|
||||
#include <fontconfig/fontconfig.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -134,42 +134,6 @@ CAIRO_BEGIN_DECLS
|
|||
#define __attribute__(x)
|
||||
#endif
|
||||
|
||||
#if HAVE_PTHREAD_H
|
||||
# include <pthread.h>
|
||||
|
||||
typedef pthread_mutex_t cairo_mutex_t;
|
||||
|
||||
#elif defined CAIRO_HAS_WIN32_SURFACE
|
||||
|
||||
/* We require Windows 2000 features. Although we don't use them here, things
|
||||
* should still work if this header file ends up being the one to include
|
||||
* windows.h into a source file, so: */
|
||||
# if !defined(WINVER) || (WINVER < 0x0500)
|
||||
# define WINVER 0x0500
|
||||
# endif
|
||||
|
||||
# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
|
||||
typedef CRITICAL_SECTION cairo_mutex_t;
|
||||
|
||||
#elif defined CAIRO_HAS_OS2_SURFACE
|
||||
# define INCL_BASE
|
||||
# define INCL_PM
|
||||
# include <os2.h>
|
||||
|
||||
typedef HMTX cairo_mutex_t;
|
||||
|
||||
#elif defined CAIRO_HAS_BEOS_SURFACE
|
||||
|
||||
typedef void* cairo_mutex_t;
|
||||
|
||||
#endif
|
||||
|
||||
#undef MIN
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
|
|
@ -203,6 +167,7 @@ do { \
|
|||
|
||||
#define CAIRO_REF_COUNT_INVALID ((unsigned int) -1)
|
||||
|
||||
#include "cairo-mutex-private.h"
|
||||
#include "cairo-wideint-private.h"
|
||||
|
||||
typedef int32_t cairo_fixed_16_16_t;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue