diff --git a/ChangeLog b/ChangeLog index 263b39eaff..2c9dd6154d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jun 21 18:32:37 2015 Nobuyoshi Nakada + + * 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 * ext/objspace/objspace_dump.c(dump_object): Return empty JSON object when diff --git a/ruby_atomic.h b/ruby_atomic.h index e2b1c87a2f..ad7d77ad55 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