diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-11 15:37:49 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:10 +0900 |
| commit | 52507b1083ba1c562ae506d63a07a51a26815c21 (patch) | |
| tree | 1c4087091f82fd792b5d81c3ef2c8c384e1854f4 /mrblib | |
| parent | 7deb41b0e88b3670476ed86bab541340f5551b52 (diff) | |
| download | mruby-52507b1083ba1c562ae506d63a07a51a26815c21.tar.gz mruby-52507b1083ba1c562ae506d63a07a51a26815c21.zip | |
Generate C struct from `irep` instead of binary dump.
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/init_mrblib.c | 11 | ||||
| -rw-r--r-- | mrblib/mrblib.rake | 17 |
2 files changed, 15 insertions, 13 deletions
diff --git a/mrblib/init_mrblib.c b/mrblib/init_mrblib.c index 4d4bcd25a..e69de29bb 100644 --- a/mrblib/init_mrblib.c +++ b/mrblib/init_mrblib.c @@ -1,11 +0,0 @@ -#include <mruby.h> -#include <mruby/irep.h> - -extern const uint8_t mrblib_irep[]; - -void -mrb_init_mrblib(mrb_state *mrb) -{ - mrb_load_irep(mrb, mrblib_irep); -} - diff --git a/mrblib/mrblib.rake b/mrblib/mrblib.rake index 6fba0adc1..724d328fa 100644 --- a/mrblib/mrblib.rake +++ b/mrblib/mrblib.rake @@ -11,8 +11,21 @@ MRuby.each_target do mkdir_p File.dirname(t.name) open(t.name, 'w') do |f| _pp "GEN", "*.rb", "#{t.name.relative_path}" - f.puts File.read("#{current_dir}/init_mrblib.c") - mrbc.run f, rbfiles, 'mrblib_irep' + f.puts %Q[/*] + f.puts %Q[ * This file is loading the mrblib] + f.puts %Q[ *] + f.puts %Q[ * IMPORTANT:] + f.puts %Q[ * This file was generated!] + f.puts %Q[ * All manual changes will get lost.] + f.puts %Q[ */] + mrbc.run f, rbfiles, 'mrblib_proc' + f.puts <<INIT_END +void +mrb_init_mrblib(mrb_state *mrb) +{ + mrb_load_proc(mrb, mrblib_proc); +} +INIT_END end end end |
