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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
349 B
Cheetah
Raw Normal View History

%# -*- 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
}