diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-17 13:21:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-17 13:21:36 +0000 |
commit | f657d9a0775d09c23faa4fb2388cd4ff88989bb3 (patch) | |
tree | ac7ef71870cbd1ebdebd43752e20b57d28e0c64e /include | |
parent | 08999fc444ec14dd5f74e5d27e91f8c51e59e799 (diff) | |
download | ruby-f657d9a0775d09c23faa4fb2388cd4ff88989bb3.tar.gz |
ruby.h: remove RB_GC_GUARD_PTR
* include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate
macro, and expand for each RB_GC_GUARD. [Fix GH-1293]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/ruby.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index bc9c08067b..5cc8718132 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -551,27 +551,19 @@ static inline int rb_type(VALUE obj); ((type) == RUBY_T_FLOAT) ? RB_FLOAT_TYPE_P(obj) : \ (!RB_SPECIAL_CONST_P(obj) && RB_BUILTIN_TYPE(obj) == (type))) -/* RB_GC_GUARD_PTR() is an intermediate macro, and has no effect by - * itself. don't use it directly */ #ifdef __GNUC__ -#define RB_GC_GUARD_PTR(ptr) \ - __extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;}) -#else -#ifdef _MSC_VER +#define RB_GC_GUARD(v) \ + (*__extension__ ({volatile VALUE *rb_gc_guarded_ptr = &(v); rb_gc_guarded_ptr;})) +#elif defined _MSC_VER #pragma optimize("", off) static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;} #pragma optimize("", on) +#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr(&(v))) #else 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)) |