summaryrefslogtreecommitdiff
path: root/ruby_atomic.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-21 09:32:40 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-21 09:32:40 (GMT)
commit9767eb3001f159835ba474cdfb72adf6cb7301b0 (patch)
treefbdf6b31b9ceadc48fb770b0c497cfeaf8af6bd3 /ruby_atomic.h
parente833adaa6997503a437bb3ab378e723afc0ba8d5 (diff)
ruby_atomic.h: refine ATOMIC_PTR_CAS
* ruby_atomic.h (ATOMIC_PTR_CAS): define by generic CAS macro, not via size_t, to suppress a warning by mingw gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_atomic.h')
-rw-r--r--ruby_atomic.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/ruby_atomic.h b/ruby_atomic.h
index e2b1c87..ad7d77a 100644
--- a/ruby_atomic.h
+++ b/ruby_atomic.h
@@ -18,6 +18,7 @@ typedef unsigned int rb_atomic_t;
# define ATOMIC_SIZE_SUB(var, val) __atomic_fetch_sub(&(var), (val), __ATOMIC_SEQ_CST)
# define ATOMIC_PTR_EXCHANGE(var, val) __atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
+# define ATOMIC_PTR_CAS(var, oldval, newval) ATOMIC_CAS(var, oldval, newval)
#elif defined HAVE_GCC_SYNC_BUILTINS
/* @shyouhei hack to support atomic operations in case of gcc. Gcc
@@ -36,6 +37,7 @@ typedef unsigned int rb_atomic_t; /* Anything OK */
# define ATOMIC_SIZE_SUB(var, val) __sync_fetch_and_sub(&(var), (val))
# define ATOMIC_PTR_EXCHANGE(var, val) __sync_lock_test_and_set(&(var), (val))
+# define ATOMIC_PTR_CAS(var, oldval, newval) ATOMIC_CAS(var, oldval, newval)
#elif defined _WIN32
#if defined _MSC_VER && _MSC_VER > 1200