summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-03 03:25:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-03 03:25:06 +0000
commitc95b3a16bdf6c9a40c3ce23734b38c1982609712 (patch)
tree81b544e69dec554d7cd508fb5984003d073a972c /include
parentb040788b527ad83c95b48b22defa07cf7f30dda3 (diff)
ruby.h: no warnings of hidden objects
* include/ruby/ruby.h (rb_data_object_alloc_warning): no warnings of internal hidden objects which klass == 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 635076f..884042a 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1173,6 +1173,15 @@ rb_data_object_alloc_warning(VALUE klass, void *ptr, RUBY_DATA_FUNC mark, RUBY_D
return rb_data_object_alloc(klass, ptr, mark, free);
}
+#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
+#define rb_data_object_alloc_warning(klass, ptr, mark, free) \
+ __extension__( \
+ __builtin_choose_expr( \
+ __builtin_constant_p(klass) && !(klass), \
+ rb_data_object_alloc(klass, ptr, mark, free), \
+ rb_data_object_alloc_warning(klass, ptr, mark, free)))
+#endif
+
static inline void *
rb_data_object_get(VALUE obj)
{