summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-09 14:53:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-09 14:53:16 +0000
commit24e1be741198228456276eba08d65abb3fb6bdb3 (patch)
treeea0701273baf789b90255d8075b0976fa5344a12 /include
parent1bcd74de17c1b727e10c0864a5e0e88c3ab502fb (diff)
* include/ruby/ruby.h (RB_GC_GUARD_PTR): get rid of removal by
optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index a9fd974614..edfa3f41a1 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -420,7 +420,8 @@ 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
-#define RB_GC_GUARD_PTR(ptr) (volatile VALUE *)(ptr)
+static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;}
+#define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr)
#endif
#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))