mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ea87854c52
* 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
17 lines
349 B
C
17 lines
349 B
C
%# -*- 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".so", func); \
|
|
}
|
|
|
|
void ruby_init_ext(const char *name, void (*init)(void));
|
|
|
|
void Init_ext(void)
|
|
{
|
|
% extinits.each do |f, n|
|
|
init(Init_<%=f%>, <%=n.dump%>);
|
|
% end
|
|
}
|