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

ruby-changes:61970

From: Nobuyoshi <ko1@a...>
Date: Sun, 28 Jun 2020 14:16:42 +0900 (JST)
Subject: [ruby-changes:61970] 09b936d89c (master): Calculate header line count instead of hardcoding

https://git.ruby-lang.org/ruby.git/commit/?id=09b936d89c

From 09b936d89cb66e38db46dbe782aa5f22f94656bc Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 28 Jun 2020 14:13:48 +0900
Subject: Calculate header line count instead of hardcoding


diff --git a/tool/mk_builtin_loader.rb b/tool/mk_builtin_loader.rb
index 16956c6..1aa52c6 100644
--- a/tool/mk_builtin_loader.rb
+++ b/tool/mk_builtin_loader.rb
@@ -204,6 +204,7 @@ def mk_builtin_header file https://github.com/ruby/ruby/blob/trunk/tool/mk_builtin_loader.rb#L204
       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 https://github.com/ruby/ruby/blob/trunk/tool/mk_builtin_loader.rb#L216
     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)|
-- 
cgit v0.10.2


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

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