1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

ruby_atomic.h: suppress warnigns

* ruby_atomic.h (ATOMIC_CAS): suppress C4022 and C4047 warnings in
  VC6.  only InterlockedCompareExchange is declared using PVOID.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-07-03 14:47:42 +00:00
parent b2be623240
commit b12ffcb15d
2 changed files with 14 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Wed Jul 3 23:47:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby_atomic.h (ATOMIC_CAS): suppress C4022 and C4047 warnings in
VC6. only InterlockedCompareExchange is declared using PVOID.
Wed Jul 3 22:29:20 2013 Tanaka Akira <akr@fsij.org>
* internal.h (ruby_digit36_to_number_table): Declared.

View file

@ -50,6 +50,15 @@ rb_w32_atomic_or(volatile rb_atomic_t *var, rb_atomic_t val)
#endif
# define ATOMIC_EXCHANGE(var, val) InterlockedExchange(&(var), (val))
# define ATOMIC_CAS(var, oldval, newval) InterlockedCompareExchange(&(var), (newval), (oldval))
# if defined _MSC_VER && _MSC_VER <= 1200
static inline rb_atomic_t
rb_w32_atomic_cas(volatile rb_atomic_t *var, rb_atomic_t oldval, rb_atomic_t newval)
{
return (rb_atomic_t)ATOMIC_CAS(*(PVOID *)var, (PVOID)oldval, (PVOID)(newval));
}
# undef ATOMIC_CAS
# define ATOMIC_CAS(var, oldval, newval) (&(var), (newval), (oldval))
# endif
# ifdef _M_AMD64
# define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd64(&(var), (val))
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd64(&(var), -(val))