From 08252d18a31efb7b945df2cbe4962fff4759b12a Mon Sep 17 00:00:00 2001 From: normal Date: Thu, 20 Feb 2014 23:45:55 +0000 Subject: 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 --- gc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index fc85cd4cee..7f9e54f08a 100644 --- a/gc.c +++ b/gc.c @@ -88,10 +88,14 @@ #define rb_setjmp(env) RUBY_SETJMP(env) #define rb_jmp_buf rb_jmpbuf_t -#if defined(HAVE_RB_GC_GUARDED_PTR) && HAVE_RB_GC_GUARDED_PTR +#if defined(HAVE_RB_GC_GUARDED_PTR_VAL) && HAVE_RB_GC_GUARDED_PTR_VAL +/* trick the compiler into thinking a external signal handler uses this */ +volatile VALUE rb_gc_guarded_val; volatile VALUE * -rb_gc_guarded_ptr(volatile VALUE *ptr) +rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val) { + rb_gc_guarded_val = val; + return ptr; } #endif -- cgit v1.2.3