diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-06-28 14:13:48 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-06-28 14:14:29 +0900 |
commit | 09b936d89cb66e38db46dbe782aa5f22f94656bc (patch) | |
tree | da2eea811e17968bad16f83e0c1e6e4db5121baa /tool | |
parent | 1020f7e3aaad9071d59df19c3377c3462af13f7c (diff) | |
download | ruby-09b936d89cb66e38db46dbe782aa5f22f94656bc.tar.gz |
Calculate header line count instead of hardcoding
Diffstat (limited to 'tool')
-rw-r--r-- | tool/mk_builtin_loader.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/mk_builtin_loader.rb b/tool/mk_builtin_loader.rb index 16956c6b92..1aa52c671c 100644 --- a/tool/mk_builtin_loader.rb +++ b/tool/mk_builtin_loader.rb @@ -204,6 +204,7 @@ def mk_builtin_header file file = file.tr(File::ALT_SEPARATOR, File::SEPARATOR) ofile = ofile.tr(File::ALT_SEPARATOR, File::SEPARATOR) end + lineno = __LINE__ f.puts "// -*- c -*-" f.puts "// DO NOT MODIFY THIS FILE DIRECTLY." f.puts "// auto-generated file" @@ -215,7 +216,7 @@ def mk_builtin_header file f.puts '#include "builtin.h" /* for RB_BUILTIN_FUNCTION */' f.puts 'struct rb_execution_context_struct; /* in vm_core.h */' f.puts - lineno = 11 + lineno = __LINE__ - lineno - 1 line_file = file inlines.each{|cfunc_name, (body_lineno, text, params, func_name)| |