зеркало из https://github.com/github/ruby.git
ruby_atomic.h: suppress a warning
* ruby_atomic.h (ATOMIC_SIZE_SUB): add cast to suppress a warning by VC++. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0712483fdd
Коммит
9f9b476710
|
@ -60,14 +60,14 @@ rb_w32_atomic_cas(volatile rb_atomic_t *var, rb_atomic_t oldval, rb_atomic_t new
|
|||
# define ATOMIC_CAS(var, oldval, newval) rb_w32_atomic_cas(&(var), (oldval), (newval))
|
||||
# endif
|
||||
# ifdef _M_AMD64
|
||||
# define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd64(&(var), (val))
|
||||
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd64(&(var), -(val))
|
||||
# define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd64((LONG_LONG *)&(var), (val))
|
||||
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd64((LONG_LONG *)&(var), -(LONG)(val))
|
||||
# define ATOMIC_SIZE_INC(var) InterlockedIncrement64(&(var))
|
||||
# define ATOMIC_SIZE_DEC(var) InterlockedDecrement64(&(var))
|
||||
# define ATOMIC_SIZE_EXCHANGE(var, val) InterlockedExchange64(&(var), (val))
|
||||
# else
|
||||
# define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd((LONG *)&(var), (val))
|
||||
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd((LONG *)&(var), -(val))
|
||||
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd((LONG *)&(var), -(LONG)(val))
|
||||
# define ATOMIC_SIZE_INC(var) InterlockedIncrement((LONG *)&(var))
|
||||
# define ATOMIC_SIZE_DEC(var) InterlockedDecrement((LONG *)&(var))
|
||||
# define ATOMIC_SIZE_EXCHANGE(var, val) InterlockedExchange((LONG *)&(var), (val))
|
||||
|
|
Загрузка…
Ссылка в новой задаче