1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

template/extinit.c.tmpl

* template/extinit.c.tmpl: separate from ext/extmk.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-01-22 12:50:36 +00:00
parent 709a60f92d
commit 78b95b49f8
3 changed files with 24 additions and 21 deletions

16
template/extinit.c.tmpl Normal file
View file

@ -0,0 +1,16 @@
%# -*- C -*-
#include "ruby/ruby.h"
#define init(func, name) { \
extern void func(void); \
ruby_init_ext(name, 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"')%>);
% end
}