summaryrefslogtreecommitdiff
path: root/include/ruby/ruby.h
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-20 23:45:55 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-20 23:45:55 +0000
commit08252d18a31efb7b945df2cbe4962fff4759b12a (patch)
tree6bb5b19b19a253915a7f28f2fe74ed944f020e8b /include/ruby/ruby.h
parent81dfa8b397d901aad66da29a1fc2ce05f66485f9 (diff)
gc.c: RB_GC_GUARD should be robust enough for any compiler
* include/ruby/ruby.h (RB_GC_GUARD): use rb_gc_guarded_ptr_val on non-GCC/MSC * gc.c (rb_gc_guarded_ptr_val): rename and adjust argument. RB_GC_GUARD should be robust enough for any compiler. [ruby-core:60816] [Bug #7805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r--include/ruby/ruby.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 55ea252d98..abd4b4bad3 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -515,12 +515,16 @@ static inline int rb_type(VALUE obj);
static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;}
#pragma optimize("", on)
#else
-volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr);
-#define HAVE_RB_GC_GUARDED_PTR 1
+volatile VALUE *rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val);
+#define HAVE_RB_GC_GUARDED_PTR_VAL 1
+#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr_val(&(v),(v)))
#endif
#define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr)
#endif
+
+#ifndef RB_GC_GUARD
#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))
+#endif
#ifdef __GNUC__
#define RB_UNUSED_VAR(x) x __attribute__ ((unused))