diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-12 00:32:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-12 00:32:32 +0000 |
commit | df3e3768e98b6bc60e8f0297c80ad7d8696e6a1e (patch) | |
tree | c6d3c0340d816b951abd62fc53ffe1482eafba99 /atomic.h | |
parent | 465b0d49d637850a7a22732e541b06295f430cee (diff) | |
download | ruby-df3e3768e98b6bc60e8f0297c80ad7d8696e6a1e.tar.gz |
* atomic.h (ATOMIC_OR): _InterlockedOr is not available on migw.
* gc.c (rb_gc_set_params): VM_OBJSPACE is disabled on mignw.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'atomic.h')
-rw-r--r-- | atomic.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2,13 +2,19 @@ #define RUBY_ATOMIC_H #ifdef _WIN32 +#ifdef _MSC_VER #pragma intrinsic(_InterlockedOr) +#endif typedef LONG rb_atomic_t; # define ATOMIC_SET(var, val) InterlockedExchange(&(var), (val)) # define ATOMIC_INC(var) InterlockedIncrement(&(var)) # define ATOMIC_DEC(var) InterlockedDecrement(&(var)) +#if defined __GNUC__ +# define ATOMIC_OR(var, val) __asm__("lock\n\t" "orl\t%1, %0" : "=m"(var) : "Ir"(val)) +#else # define ATOMIC_OR(var, val) _InterlockedOr(&(var), (val)) +#endif # define ATOMIC_EXCHANGE(var, val) InterlockedExchange(&(var), (val)) #elif defined HAVE_GCC_ATOMIC_BUILTINS |