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

ruby-changes:42005

From: nobu <ko1@a...>
Date: Thu, 10 Mar 2016 16:27:45 +0900 (JST)
Subject: [ruby-changes:42005] nobu:r54079 (trunk): node.c: stringize before expansion

nobu	2016-03-10 16:27:40 +0900 (Thu, 10 Mar 2016)

  New Revision: 54079

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

  Log:
    node.c: stringize before expansion
    
    * node.c (F_NODE, F_OPTION): stringize member names defined as
      macros before expansion.

  Modified files:
    trunk/node.c
Index: node.c
===================================================================
--- node.c	(revision 54078)
+++ node.c	(revision 54079)
@@ -38,8 +38,8 @@ https://github.com/ruby/ruby/blob/trunk/node.c#L38
     } while (0)
 
 #define COMPOUND_FIELD1(name, ann, block) \
-    COMPOUND_FIELD(FIELD_NAME_LEN(#name, ann), \
-		   FIELD_NAME_DESC(#name, ann), \
+    COMPOUND_FIELD(FIELD_NAME_LEN(name, ann), \
+		   FIELD_NAME_DESC(name, ann), \
 		   block)
 
 #define FIELD_NAME_DESC(name, ann) name " (" ann ")"
@@ -62,9 +62,9 @@ https://github.com/ruby/ruby/blob/trunk/node.c#L62
 #define F_MSG(name, ann, desc)	    SIMPLE_FIELD1(#name, ann) A(desc)
 
 #define F_NODE(name, ann) \
-    COMPOUND_FIELD1(name, ann, dump_node(buf, indent, comment, node->name))
+    COMPOUND_FIELD1(#name, ann, dump_node(buf, indent, comment, node->name))
 #define F_OPTION(name, ann) \
-    COMPOUND_FIELD1(name, ann, dump_option(buf, indent, node->name))
+    COMPOUND_FIELD1(#name, ann, dump_option(buf, indent, node->name))
 
 #define ANN(ann) \
     if (comment) { \

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

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