summaryrefslogtreecommitdiff
path: root/upb/refcounted.c
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2014-08-09 03:43:32 -0700
committerJosh Haberman <jhaberman@gmail.com>2014-08-09 03:43:32 -0700
commitd869097400048af4b943e0679bab21b759facb80 (patch)
tree933247f287a427202dc98904419e7dd27e683574 /upb/refcounted.c
parentcf2a959fa1fa48ca068dfecb6bee660b0a2ff395 (diff)
Make the absence of perf-cppflags give a good default build.
Defaults are now: - thread-safe with GCC/Clang - Debugging not enabled (enable with -UNDEBUG)
Diffstat (limited to 'upb/refcounted.c')
-rw-r--r--upb/refcounted.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/upb/refcounted.c b/upb/refcounted.c
index cba535f..ca97d9f 100644
--- a/upb/refcounted.c
+++ b/upb/refcounted.c
@@ -35,7 +35,7 @@ const void *UPB_UNTRACKED_REF = &untracked_val;
static void atomic_inc(uint32_t *a) { (*a)++; }
static bool atomic_dec(uint32_t *a) { return --(*a) == 0; }
-#elif (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || __GNUC__ > 4 ///////////////////
+#elif defined(__GNUC__) || defined(__clang__) //////////////////////////////////
static void atomic_inc(uint32_t *a) { __sync_fetch_and_add(a, 1); }
static bool atomic_dec(uint32_t *a) { return __sync_sub_and_fetch(a, 1) == 0; }
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback