зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
b040788b52
Коммит
c95b3a16bd
|
@ -20,7 +20,11 @@
|
|||
#endif
|
||||
|
||||
#undef RUBY_UNTYPED_DATA_WARNING
|
||||
#ifdef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
|
||||
#define RUBY_UNTYPED_DATA_WARNING 1
|
||||
#else
|
||||
#define RUBY_UNTYPED_DATA_WARNING 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RB_THREAD_CHECK_TRAP_PENDING
|
||||
static int rb_thread_critical; /* dummy */
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче