1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix fake.rb expansion from preprocessed version.h

This commit is contained in:
Nobuyoshi Nakada 2022-09-05 11:25:42 +09:00
parent 85a483169f
commit 1420333455
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -18,14 +18,13 @@ def src.value(name)
end
eval(val.gsub(/#/, '\\#').gsub(/((?:\G|[^\\])(?:\\\\)*)\n/, '\1'))
end
version = Hash.new {|h, v| h[v] || src.value(v)}
arg['versions'] = version
arg['versions'] = version = {}
File.read(File.join(arg['srcdir'], 'version.c')).
scan(/rb_define_global_const\("(RUBY_\w+)",[^;]*?\bMK(?:INT|(STR))\(([^()]*)\)/m) do |n, s, v|
version[n] = arg[v] || (s ? "" : 0)
version[n] = arg[v] || src.value(v) || (s ? "" : 0)
end
arg['RUBY_DESCRIPTION_WITH_MJIT'] = arg['description_with_mjit'] || ""
arg['RUBY_DESCRIPTION_WITH_YJIT'] = arg['description_with_yjit'] || ""
arg['RUBY_DESCRIPTION_WITH_MJIT'] = src.value('description_with_mjit') || version['RUBY_DESCRIPTION']
arg['RUBY_DESCRIPTION_WITH_YJIT'] = src.value('description_with_yjit') || version['RUBY_DESCRIPTION']
%>baseruby="<%=arg['BASERUBY']%>"
_\
=begin