summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authortarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-24 16:11:05 +0000
committertarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-24 16:11:05 +0000
commit12c2e07a3de52d139baf206b215ead95861c7da8 (patch)
tree895802036aaa42f065cafd63fb275d7fd22f87e8 /include
parentf5ea2822e6aab93b2b9a4f52d27f059dc4a9c43e (diff)
* 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/trunk@28423 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 37c3e47e40..d4ffe10d8c 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)))