ruby-changes:38903
From: nobu <ko1@a...>
Date: Sun, 21 Jun 2015 18:33:00 +0900 (JST)
Subject: [ruby-changes:38903] nobu:r50984 (trunk): ruby_atomic.h: refine ATOMIC_PTR_CAS
nobu 2015-06-21 18:32:40 +0900 (Sun, 21 Jun 2015) New Revision: 50984 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50984 Log: 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. Modified files: trunk/ChangeLog trunk/ruby_atomic.h Index: ChangeLog =================================================================== --- ChangeLog (revision 50983) +++ ChangeLog (revision 50984) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Jun 21 18:32:37 2015 Nobuyoshi Nakada <nobu@r...> + + * ruby_atomic.h (ATOMIC_PTR_CAS): define by generic CAS macro, not + via size_t, to suppress a warning by mingw gcc. + Sun Jun 21 05:31:41 2015 Shota Fukumori <her@s...> * ext/objspace/objspace_dump.c(dump_object): Return empty JSON object when Index: ruby_atomic.h =================================================================== --- ruby_atomic.h (revision 50983) +++ ruby_atomic.h (revision 50984) @@ -18,6 +18,7 @@ typedef unsigned int rb_atomic_t; https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L18 # 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; /* Any https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L37 # 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/