diff options
Diffstat (limited to 'fontconfig/src/fcatomic.h')
-rw-r--r-- | fontconfig/src/fcatomic.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fontconfig/src/fcatomic.h b/fontconfig/src/fcatomic.h index 72ae37280..a76431139 100644 --- a/fontconfig/src/fcatomic.h +++ b/fontconfig/src/fcatomic.h @@ -87,6 +87,18 @@ typedef int fc_atomic_int_t; #define fc_atomic_ptr_cmpexch(P,O,N) __sync_bool_compare_and_swap ((P), (O), (N)) +#elif !defined(FC_NO_MT) && defined(HAVE_SOLARIS_ATOMIC_OPS) + +#include <atomic.h> +#include <mbarrier.h> + +typedef unsigned int fc_atomic_int_t; +#define fc_atomic_int_add(AI, V) ( ({__machine_rw_barrier ();}), atomic_add_int_nv (&(AI), (V)) - (V)) + +#define fc_atomic_ptr_get(P) ( ({__machine_rw_barrier ();}), (void *) *(P)) +#define fc_atomic_ptr_cmpexch(P,O,N) ( ({__machine_rw_barrier ();}), atomic_cas_ptr ((P), (O), (N)) == (void *) (O) ? FcTrue : FcFalse) + + #elif !defined(FC_NO_MT) #define FC_ATOMIC_INT_NIL 1 /* Warn that fallback implementation is in use. */ |