aboutsummaryrefslogtreecommitdiffstats
path: root/ruby_atomic.h
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-02 06:41:53 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-02 06:41:53 +0000
commita6b50f379d4b71acac73ac6b22cbe2d2c5b50b3f (patch)
treed61a726ab3871a8ab56541b5201c30c59271fc55 /ruby_atomic.h
parenta5a5714b77ff356742fe0fceab1d97ac123116e0 (diff)
downloadruby-a6b50f379d4b71acac73ac6b22cbe2d2c5b50b3f.tar.gz
statement experssion is a GCCism
should mark as such. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_atomic.h')
-rw-r--r--ruby_atomic.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/ruby_atomic.h b/ruby_atomic.h
index 4bc9f37e0d..f74cf997a1 100644
--- a/ruby_atomic.h
+++ b/ruby_atomic.h
@@ -9,10 +9,10 @@ typedef unsigned int rb_atomic_t;
# define ATOMIC_DEC(var) __atomic_fetch_sub(&(var), 1, __ATOMIC_SEQ_CST)
# define ATOMIC_OR(var, val) __atomic_fetch_or(&(var), (val), __ATOMIC_SEQ_CST)
# define ATOMIC_EXCHANGE(var, val) __atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
-# define ATOMIC_CAS(var, oldval, newval) \
-({ __typeof__(var) oldvaldup = (oldval); /* oldval should not be modified */ \
+# define ATOMIC_CAS(var, oldval, newval) RB_GNUC_EXTENSION_BLOCK( \
+ __typeof__(var) oldvaldup = (oldval); /* oldval should not be modified */ \
__atomic_compare_exchange_n(&(var), &oldvaldup, (newval), 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); \
- oldvaldup; })
+ oldvaldup )
# define ATOMIC_SIZE_ADD(var, val) __atomic_fetch_add(&(var), (val), __ATOMIC_SEQ_CST)
# define ATOMIC_SIZE_SUB(var, val) __atomic_fetch_sub(&(var), (val), __ATOMIC_SEQ_CST)