[前][次][番号順一覧][スレッド一覧]

ruby-changes:36611

From: nobu <ko1@a...>
Date: Wed, 3 Dec 2014 12:25:15 +0900 (JST)
Subject: [ruby-changes:36611] nobu:r48692 (trunk): ruby.h: no warnings of hidden objects

nobu	2014-12-03 12:25:06 +0900 (Wed, 03 Dec 2014)

  New Revision: 48692

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48692

  Log:
    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.

  Modified files:
    trunk/ext/tk/tcltklib.c
    trunk/include/ruby/ruby.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 48691)
+++ include/ruby/ruby.h	(revision 48692)
@@ -1173,6 +1173,15 @@ rb_data_object_alloc_warning(VALUE klass https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1173
     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)
 {
Index: ext/tk/tcltklib.c
===================================================================
--- ext/tk/tcltklib.c	(revision 48691)
+++ ext/tk/tcltklib.c	(revision 48692)
@@ -20,7 +20,11 @@ https://github.com/ruby/ruby/blob/trunk/ext/tk/tcltklib.c#L20
 #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 */

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]