From de4b26bf1061ae9c15cc0d393ea14f7950ea4975 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 23 Jan 2017 02:19:00 +0000 Subject: extinit.c.tmpl: drop after dot * template/extinit.c.tmpl: drop rest from the first dot in the base name of a feature is ignored since r30464. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- template/extinit.c.tmpl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'template') diff --git a/template/extinit.c.tmpl b/template/extinit.c.tmpl index 592eb0452f..7a9c910633 100644 --- a/template/extinit.c.tmpl +++ b/template/extinit.c.tmpl @@ -1,16 +1,17 @@ %# -*- C -*- +% extinits = ARGV.map {|n| [n[%r[[^/.]+(?=\.[^/]*)?\z]], n]} #include "ruby/ruby.h" #define init(func, name) { \ extern void func(void); \ - ruby_init_ext(name, func); \ + ruby_init_ext(name".so", func); \ } void ruby_init_ext(const char *name, void (*init)(void)); void Init_ext(void) { -% ARGV.each do |n| - init(Init_<%=n.sub(/,(.*)/, ', "\1.so"')%>); +% extinits.each do |f, n| + init(Init_<%=f%>, <%=n.dump%>); % end } -- cgit v1.2.3