зеркало из https://github.com/github/ruby.git
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:
Родитель
72bbf60f3a
Коммит
34fd7241e4
|
@ -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))
|
||||
|
|
Загрузка…
Ссылка в новой задаче