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

ruby-changes:36202

From: nobu <ko1@a...>
Date: Wed, 5 Nov 2014 17:20:44 +0900 (JST)
Subject: [ruby-changes:36202] nobu:r48283 (trunk): intern.h: deprecate disable and enable super

nobu	2014-11-05 17:20:31 +0900 (Wed, 05 Nov 2014)

  New Revision: 48283

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

  Log:
    intern.h: deprecate disable and enable super
    
    * include/ruby/intern.h (rb_disable_super, rb_enable_super): warn
      as deprecated at build time, instead of ignoring silently or
      warning at runtime only.

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/intern.h
    trunk/vm_method.c
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 48282)
+++ include/ruby/intern.h	(revision 48283)
@@ -371,8 +371,18 @@ VALUE rb_f_exit(int, const VALUE*); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L371
 VALUE rb_f_abort(int, const VALUE*);
 void rb_remove_method(VALUE, const char*);
 void rb_remove_method_id(VALUE, ID);
-#define rb_disable_super(klass, name) ((void)0)
-#define rb_enable_super(klass, name) ((void)0)
+DEPRECATED(static inline void rb_disable_super(void));
+DEPRECATED(static inline void rb_enable_super(void));
+static inline void rb_disable_super(void)
+{
+    /* obsolete - no use */
+}
+static inline void rb_enable_super(void)
+{
+    rb_warning("rb_enable_super() is obsolete");
+}
+#define rb_disable_super(klass, name) rb_disable_super()
+#define rb_enable_super(klass, name) rb_enable_super()
 #define HAVE_RB_DEFINE_ALLOC_FUNC 1
 typedef VALUE (*rb_alloc_func_t)(VALUE);
 void rb_define_alloc_func(VALUE, rb_alloc_func_t);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48282)
+++ ChangeLog	(revision 48283)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Nov  5 17:20:29 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* include/ruby/intern.h (rb_disable_super, rb_enable_super): warn
+	  as deprecated at build time, instead of ignoring silently or
+	  warning at runtime only.
+
 Wed Nov  5 16:55:52 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* proc.c (rb_f_lambda): remove deprecated function, which has been
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 48282)
+++ vm_method.c	(revision 48283)
@@ -814,21 +814,6 @@ rb_mod_remove_method(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/vm_method.c#L814
     return mod;
 }
 
-#undef rb_disable_super
-#undef rb_enable_super
-
-void
-rb_disable_super(VALUE klass, const char *name)
-{
-    /* obsolete - no use */
-}
-
-void
-rb_enable_super(VALUE klass, const char *name)
-{
-    rb_warning("rb_enable_super() is obsolete");
-}
-
 static void
 rb_export_method(VALUE klass, ID name, rb_method_flag_t noex)
 {

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

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