diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-22 12:50:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-22 12:50:36 +0000 |
commit | 78b95b49f8715a4782f5b9bdc4c163e445cdc303 (patch) | |
tree | 2663d78a4c0516cb6533267a248e40f4b1a6af9c /template | |
parent | 709a60f92d1f922211c7f9e0c8a3f72a23bf8d11 (diff) | |
download | ruby-78b95b49f8715a4782f5b9bdc4c163e445cdc303.tar.gz |
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
Diffstat (limited to 'template')
-rw-r--r-- | template/extinit.c.tmpl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/template/extinit.c.tmpl b/template/extinit.c.tmpl new file mode 100644 index 0000000000..592eb0452f --- /dev/null +++ b/template/extinit.c.tmpl @@ -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 +} |