From 248af38b3efa3f96225eea43f4ba5b94baff34a6 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Wed, 28 Apr 2010 17:23:47 +0200 Subject: atomic: Add MacOSX atomic implementation Enable atomic operation on MacOS X, using the functions provided by libkern/OSAtomic.h Reviewed-by: Chris Wilson --- build/aclocal.cairo.m4 | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'build') diff --git a/build/aclocal.cairo.m4 b/build/aclocal.cairo.m4 index 482763eb..f271ccf9 100644 --- a/build/aclocal.cairo.m4 +++ b/build/aclocal.cairo.m4 @@ -174,6 +174,11 @@ int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i AC_CHECK_HEADER([atomic_ops.h], cairo_cv_atomic_primitives="libatomic-ops") fi + + if test "x$cairo_cv_atomic_primitives" = "xnone"; then + AC_CHECK_HEADER([libkern/OSAtomic.h], + cairo_cv_atomic_primitives="OSAtomic") + fi ]) if test "x$cairo_cv_atomic_primitives" = xIntel; then AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1, @@ -184,6 +189,11 @@ int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed]) fi + + if test "x$cairo_cv_atomic_primitives" = xOSAtomic; then + AC_DEFINE(HAVE_OS_ATOMIC_OPS, 1, + [Enable if you have MacOS X atomic operations]) + fi ]) dnl Usage: -- cgit v1.2.3