aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 13:21:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 13:21:36 +0000
commit37153c03f89fb3b56e3216f1d530babc82d770da (patch)
treeac7ef71870cbd1ebdebd43752e20b57d28e0c64e
parente1ee61bfbdc89968bf9851d0d825d500704ff149 (diff)
downloadruby-37153c03f89fb3b56e3216f1d530babc82d770da.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
-rw-r--r--ChangeLog5
-rw-r--r--include/ruby/ruby.h16
2 files changed, 9 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index c6f38747e2..e2f7a3f98e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Mar 17 22:21:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate
+ macro, and expand for each RB_GC_GUARD. [Fix GH-1293]
+
Thu Mar 17 22:08:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* compile.c (iseq_specialized_instruction): move specialization
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))