fine-grained #ifdef guard for Sparc systems

There are cases when sizeof(int) == sizeof(long) == sizeof(size_t).  On
such cases however int and long are incompatible types in theory.  We
should not assume typedef long size_t, because on Solaris size_t is
actually a typedef of int.

This reduces compiler warnings on such situations.
This commit is contained in:
卜部昌平 2020-01-31 15:07:40 +09:00
Родитель 72bbf60f3a
Коммит 34fd7241e4
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -105,7 +105,7 @@ typedef unsigned int rb_atomic_t;
# define ATOMIC_EXCHANGE(var, val) atomic_swap_uint(&(var), (val))
# define ATOMIC_CAS(var, oldval, newval) atomic_cas_uint(&(var), (oldval), (newval))
# if SIZEOF_SIZE_T == SIZEOF_LONG
# if defined(_LP64) || defined(_I32LPx)
# define ATOMIC_SIZE_ADD(var, val) atomic_add_long(&(var), (val))
# define ATOMIC_SIZE_SUB(var, val) atomic_add_long(&(var), -(val))
# define ATOMIC_SIZE_INC(var) atomic_inc_ulong(&(var))