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

ruby-changes:39481

From: nobu <ko1@a...>
Date: Thu, 13 Aug 2015 13:42:19 +0900 (JST)
Subject: [ruby-changes:39481] nobu:r51562 (trunk): id_table.c: TOKEN_PASTE

nobu	2015-08-13 13:41:54 +0900 (Thu, 13 Aug 2015)

  New Revision: 51562

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

  Log:
    id_table.c: TOKEN_PASTE
    
    * id_table.c (IMPL1): use TOKEN_PASTE, and prevent `op' from
      expansion.

  Modified files:
    trunk/id_table.c
Index: id_table.c
===================================================================
--- id_table.c	(revision 51561)
+++ id_table.c	(revision 51562)
@@ -1503,9 +1503,8 @@ mix_id_table_foreach_values(struct mix_i https://github.com/ruby/ruby/blob/trunk/id_table.c#L1503
 #endif /* ID_TABLE_USE_MIX */
 
 /* IMPL(create) will be "hash_id_table_create" and so on */
-#define IMPL2(name, op) name##_##op
-#define IMPL1(name, op) IMPL2(name, op)
-#define IMPL(op)        IMPL1(ID_TABLE_NAME, id_table##op)
+#define IMPL1(name, op) TOKEN_PASTE(name, _id##op) /* expand `name' */
+#define IMPL(op)        IMPL1(ID_TABLE_NAME, _table##op) /* but prevent `op' */
 
 struct rb_id_table *rb_id_table_create(size_t size) {return (struct rb_id_table *)IMPL(_create)(size);}
 void rb_id_table_free(struct rb_id_table *tbl)      {       IMPL(_free)((ID_TABLE_IMPL_TYPE *)tbl);}

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

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