aboutsummaryrefslogtreecommitdiffstats
path: root/id_table.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-13 04:41:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-13 04:41:54 +0000
commit2f7d8b963a4407438d8c0b066fb652a61a834138 (patch)
tree1d8568f0419553260ab7c7a42510b8f96bb8485d /id_table.c
parent5b6a10f2b43d4fa0d4bd6d5576c441de7fa13201 (diff)
downloadruby-2f7d8b963a4407438d8c0b066fb652a61a834138.tar.gz
id_table.c: TOKEN_PASTE
* id_table.c (IMPL1): use TOKEN_PASTE, and prevent `op' from expansion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'id_table.c')
-rw-r--r--id_table.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/id_table.c b/id_table.c
index d6c5e26c9c..6307cc853a 100644
--- a/id_table.c
+++ b/id_table.c
@@ -1503,9 +1503,8 @@ mix_id_table_foreach_values(struct mix_id_table *tbl, enum rb_id_table_iterator_
#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);}