[cairo-commit] build/aclocal.cairo.m4

Chris Wilson ickle at kemper.freedesktop.org
Tue Oct 21 01:23:34 PDT 2008


 build/aclocal.cairo.m4 |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit fd1f3c27e093b1f51f0c1a381cc02cbf8f9889d7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Oct 21 09:17:56 2008 +0100

    [configure] Check for atomic xchg.
    
    Bug 18140 identifies a case where we have an atomic increment, but not an
    atomic exchange. We need both to implement atomic reference counting, so
    add a second check to detect whether __sync_val_compare_and_swap
    generates a non-atomic instruction.
    
    Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18140.

diff --git a/build/aclocal.cairo.m4 b/build/aclocal.cairo.m4
index 8292e8e..f00b137 100644
--- a/build/aclocal.cairo.m4
+++ b/build/aclocal.cairo.m4
@@ -101,7 +101,10 @@ AC_DEFUN([CAIRO_CHECK_NATIVE_ATOMIC_PRIMITIVES],
 	[
 		cairo_cv_atomic_primitives="none"
 
-		AC_TRY_LINK([int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }], [],
+		AC_TRY_LINK([
+int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }
+int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i, j, k); }
+], [],
 		  cairo_cv_atomic_primitives="Intel"
 		  )
 	])


More information about the cairo-commit mailing list