summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authortarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-28 16:42:34 +0000
committertarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-28 16:42:34 +0000
commit7e80dc06b715d3cf722263b323e6edfd011fbed0 (patch)
tree357836f58a6d95bc7a2aaf7a67bab993505406c7 /include
parent4d97228014e0d78a3b271d3b4f7a070b6826dc49 (diff)
merge from trunk (r28423)
* include/ruby/ruby.h (static inline rb_gc_guarded_ptr): prevent RB_GC_GUARD_PTR being removed by optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 7c6e35bd14..ff4912847e 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -420,7 +420,13 @@ static inline int rb_type(VALUE obj);
#define RB_GC_GUARD_PTR(ptr) \
__extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;})
#else
+#ifdef _MSC_VER
+#pragma optimize("", off)
+#endif
static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;}
+#ifdef _MSC_VER
+#pragma optimize("", on)
+#endif
#define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr)
#endif
#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))