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

ruby-changes:58674

From: Nobuyoshi <ko1@a...>
Date: Sat, 9 Nov 2019 18:46:13 +0900 (JST)
Subject: [ruby-changes:58674] 95aed94d2a (master): Fixed `#line` directives in miniprelude.c

https://git.ruby-lang.org/ruby.git/commit/?id=95aed94d2a

From 95aed94d2aba5ff93425f26ae6181607996d8ca3 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 9 Nov 2019 18:44:06 +0900
Subject: Fixed `#line` directives in miniprelude.c


diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl
index 99dc25f..71f015f 100644
--- a/template/prelude.c.tmpl
+++ b/template/prelude.c.tmpl
@@ -30,8 +30,8 @@ class Prelude https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L30
     "<internal:" + prelude_base(filename) + ">"
   end
 
-  def initialize(init_name, preludes, vpath)
-    @init_name = init_name
+  def initialize(output, preludes, vpath)
+    @output = output
     @have_sublib = false
     @vpath = vpath
     @preludes = {}
@@ -114,7 +114,7 @@ static const struct { https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L114
 %     size += line.size
 "<%=c_esc(line)%>"<%if comment%>/* <%=c_esc(comment)%> */<%end%>
 %   }
-#line <%=_erbout.count("\n")+2%> "<%=@init_name%>.c"
+#line <%=_erbout.count("\n")+2%> "<%=@output%>"
 };
 % }
 
@@ -201,8 +201,9 @@ prelude_require(VALUE self, VALUE nth) https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L201
 
 % end
 %end
+% init_name = @output && @output[/\w+(?=_prelude.c\b)/] || 'prelude'
 void
-Init_<%=@init_name%><%=%>(void)
+Init_<%=init_name%><%=%>(void)
 {
 %unless @preludes.empty?
 % if @have_sublib
-- 
cgit v0.10.2


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

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