From c4fcbad1cb603756dc4dac65392feb86be1a722d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Jan 2020 09:19:06 +0200 Subject: Rename module_base to module, redo module boot/init argument passing --- libbuild2/module.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'libbuild2/module.cxx') diff --git a/libbuild2/module.cxx b/libbuild2/module.cxx index cc79af0..191853a 100644 --- a/libbuild2/module.cxx +++ b/libbuild2/module.cxx @@ -521,7 +521,11 @@ namespace build2 i = lm.emplace (mod, module_state {true, false, mf.init, nullptr, loc}).first; - i->second.first = mf.boot (rs, loc, i->second.module); + + { + module_boot_extra extra {i->second.module}; + i->second.first = mf.boot (rs, loc, extra); + } rs.assign (rs.var_pool ().insert (mod + ".booted")) = true; } @@ -608,7 +612,12 @@ namespace build2 else { l = i != lm.end (); - c = l && i->second.init (rs, bs, loc, i->second.module, f, opt, hints); + + if ((c = l)) + { + module_init_extra extra {i->second.module, hints}; + c = i->second.init (rs, bs, loc, f, opt, extra); + } lv = l; cv = c; @@ -641,7 +650,7 @@ namespace build2 init_module (rs, bs, name, loc, opt, hints); } - unique_ptr& + const shared_ptr& load_module (scope& rs, scope& bs, const string& name, -- cgit v1.1