From 90cb7d30487ddc6e9e3b70ea60bd9ad624d8e716 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Sat, 13 Jan 2018 10:47:33 +0000 Subject: __VA_ARGS__ is a C99ism give up CALL_ATTRIBUTE macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/ruby_vm/views/_attributes.erb | 2 -- tool/ruby_vm/views/_insn_stack_increase.erb | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'tool') diff --git a/tool/ruby_vm/views/_attributes.erb b/tool/ruby_vm/views/_attributes.erb index 258bf02906..d15299c235 100644 --- a/tool/ruby_vm/views/_attributes.erb +++ b/tool/ruby_vm/views/_attributes.erb @@ -10,8 +10,6 @@ typedef unsigned long lindex_t; typedef VALUE GENTRY; typedef rb_iseq_t *ISEQ; -#define CALL_ATTRIBUTE(name, insn, ...) attr_ ## name ## _ ## insn(__VA_ARGS__) - % attrs = RubyVM::Instructions.map(&:attributes).flatten % % attrs.each do |a| diff --git a/tool/ruby_vm/views/_insn_stack_increase.erb b/tool/ruby_vm/views/_insn_stack_increase.erb index bfe0a3dc6b..84f5dbc935 100644 --- a/tool/ruby_vm/views/_insn_stack_increase.erb +++ b/tool/ruby_vm/views/_insn_stack_increase.erb @@ -35,11 +35,10 @@ insn_stack_increase_dispatch(enum ruby_vminsn_type insn, const VALUE *opes) % RubyVM::Instructions.each do |i| % next unless i.has_attribute?('sp_inc') case <%= i.bin %>: - return CALL_ATTRIBUTE(sp_inc, <%= i.name %><%= + return attr_sp_inc_<%= i.name %>(<%= i.opes.map.with_index do |v, j| - k = i.cast_from_VALUE v, "opes[#{j}]" - next ", #{k}" - end.join + i.cast_from_VALUE v, "opes[#{j}]" + end.join(", ") %>); % end } -- cgit v1.2.3