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

ruby-changes:62723

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Thu, 27 Aug 2020 16:42:23 +0900 (JST)
Subject: [ruby-changes:62723] 5ca44076f4 (master): include/ruby/backward/2/rmodule.h: deprecate

https://git.ruby-lang.org/ruby.git/commit/?id=5ca44076f4

From 5ca44076f47dce3a70b5f4755f5195f0f9093fc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Wed, 22 Jul 2020 15:37:28 +0900
Subject: include/ruby/backward/2/rmodule.h: deprecate

Only one function in only one file uses contents of this public header.
That is not a wise idea.  Let's just free the header's soul.

diff --git a/class.c b/class.c
index 9876e99..857d863 100644
--- a/class.c
+++ b/class.c
@@ -1027,7 +1027,7 @@ include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super) https://github.com/ruby/ruby/blob/trunk/class.c#L1027
         VALUE super_class = RCLASS_SUPER(c);
 
         // invalidate inline method cache
-        tbl = RMODULE_M_TBL(module);
+        tbl = RCLASS_M_TBL(module);
         if (tbl && rb_id_table_size(tbl)) {
             if (search_super) { // include
                 if (super_class && !RB_TYPE_P(super_class, T_MODULE)) {
@@ -1070,11 +1070,11 @@ include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super) https://github.com/ruby/ruby/blob/trunk/class.c#L1070
 	    VALUE refined_class =
 		rb_refinement_module_get_refined_class(klass);
 
-            rb_id_table_foreach(RMODULE_M_TBL(module), add_refined_method_entry_i, (void *)refined_class);
+            rb_id_table_foreach(RCLASS_M_TBL(module), add_refined_method_entry_i, (void *)refined_class);
 	    FL_SET(c, RMODULE_INCLUDED_INTO_REFINEMENT);
 	}
 
-	tbl = RMODULE_CONST_TBL(module);
+        tbl = RCLASS_CONST_TBL(module);
 	if (tbl && rb_id_table_size(tbl)) constant_changed = 1;
       skip:
 	module = RCLASS_SUPER(module);
diff --git a/include/ruby/backward/2/rmodule.h b/include/ruby/backward/2/rmodule.h
index 81ce913..a3e2d39 100644
--- a/include/ruby/backward/2/rmodule.h
+++ b/include/ruby/backward/2/rmodule.h
@@ -28,4 +28,10 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/2/rmodule.h#L28
 #define RMODULE_CONST_TBL(m) RCLASS_CONST_TBL(m)
 #define RMODULE_M_TBL(m) RCLASS_M_TBL(m)
 #define RMODULE_SUPER(m) RCLASS_SUPER(m)
+
+#if defined(__GNUC__)
+# warning RMODULE_* macros are deprecated
+#elif defined(_MSC_VER)
+# pragma message("warning: RMODULE_* macros are deprecated")
+#endif
 #endif /* RUBY_BACKWARD2_RMODULE_H */
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 33d7528..c68168d 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -51,7 +51,6 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L51
 #include "ruby/backward/2/assume.h"
 #include "ruby/backward/2/inttypes.h"
 #include "ruby/backward/2/limits.h"
-#include "ruby/backward/2/rmodule.h"
 
 RBIMPL_SYMBOL_EXPORT_BEGIN()
 
-- 
cgit v0.10.2


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

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