mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Align the implementation precedences with rb_atomic_t
definition
On MinGW, where both of Win32 API and GCC built-ins are available, the mismatch of implementations to the definition caused lots of warnings.
This commit is contained in:
parent
b929af430c
commit
63297c2ca4
1 changed files with 12 additions and 0 deletions
|
@ -430,6 +430,9 @@ rbimpl_atomic_inc(volatile rb_atomic_t *ptr)
|
|||
{
|
||||
#if 0
|
||||
|
||||
#elif defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_SYNC_BUILTINS)
|
||||
rbimpl_atomic_add(ptr, 1);
|
||||
|
||||
#elif defined(_WIN32)
|
||||
InterlockedIncrement(ptr);
|
||||
|
||||
|
@ -450,6 +453,9 @@ rbimpl_atomic_size_inc(volatile size_t *ptr)
|
|||
{
|
||||
#if 0
|
||||
|
||||
#elif defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_SYNC_BUILTINS)
|
||||
rbimpl_atomic_size_add(ptr, 1);
|
||||
|
||||
#elif defined(_WIN32) && defined(_M_AMD64)
|
||||
InterlockedIncrement64(ptr);
|
||||
|
||||
|
@ -558,6 +564,9 @@ rbimpl_atomic_dec(volatile rb_atomic_t *ptr)
|
|||
{
|
||||
#if 0
|
||||
|
||||
#elif defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_SYNC_BUILTINS)
|
||||
rbimpl_atomic_sub(ptr, 1);
|
||||
|
||||
#elif defined(_WIN32)
|
||||
InterlockedDecrement(ptr);
|
||||
|
||||
|
@ -578,6 +587,9 @@ rbimpl_atomic_size_dec(volatile size_t *ptr)
|
|||
{
|
||||
#if 0
|
||||
|
||||
#elif defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_GCC_SYNC_BUILTINS)
|
||||
rbimpl_atomic_size_sub(ptr, 1);
|
||||
|
||||
#elif defined(_WIN32) && defined(_M_AMD64)
|
||||
InterlockedDecrement64(ptr);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue