heimdal: added HEIM_BASE_NON_ATOMIC option
authorAndrew Tridgell <tridge@opensolaris.home.tridgell.net>
Tue, 16 Nov 2010 03:53:13 +0000 (22:53 -0500)
committerAndrew Tridgell <tridge@samba.org>
Wed, 17 Nov 2010 12:55:39 +0000 (23:55 +1100)
This allows heimdal to build without gcc, by not using atomic
operations. We don't need heimdal to be atomic in Samba.

source4/heimdal/base/baselocl.h

index 3932378b2d71595a2283c72db946c60dbd264fad..06806d27626f676cfa167315a342c1856393a584 100644 (file)
 #include <dispatch/dispatch.h>
 #endif
 
-#ifdef __GNUC__
+#if HEIM_BASE_NON_ATOMIC
+/* non-atomic varients */
+#define heim_base_atomic_inc(x) ++(*(x))
+#define heim_base_atomic_dec(x) --(*(x))
+#define heim_base_atomic_type  unsigned int
+#define heim_base_atomic_max    UINT_MAX
+
+#elif defined(__GNUC__)
 #define heim_base_atomic_inc(x) __sync_add_and_fetch((x), 1)
 #define heim_base_atomic_dec(x) __sync_sub_and_fetch((x), 1)
 #define heim_base_atomic_type  unsigned int