diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-04-19 04:39:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-04-19 04:39:45 +0200 |
commit | 457f65414031f45174f3c35230a0c0e1de88b51a (patch) | |
tree | b13e1e2e2291e65d2b22058706909d8df0cc59c2 /libbuild2/config | |
parent | 950a84c337f317388cf39a3820125e049c598b8d (diff) |
Switch to using std::function for target::data_pad
Diffstat (limited to 'libbuild2/config')
-rw-r--r-- | libbuild2/config/functions.cxx | 5 | ||||
-rw-r--r-- | libbuild2/config/operation.cxx | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/libbuild2/config/functions.cxx b/libbuild2/config/functions.cxx index 398512c..3d35a01 100644 --- a/libbuild2/config/functions.cxx +++ b/libbuild2/config/functions.cxx @@ -40,7 +40,10 @@ namespace build2 if (s == nullptr) fail << "config.save() called out of project" << endf; - module* mod (s->find_module<module> (module::name)); + // See save_config() for details. + // + assert (s->ctx.phase == run_phase::load); + module* mod (s->rw ().find_module<module> (module::name)); if (mod == nullptr) fail << "config.save() called without config module"; diff --git a/libbuild2/config/operation.cxx b/libbuild2/config/operation.cxx index 98ad9d0..ed98f90 100644 --- a/libbuild2/config/operation.cxx +++ b/libbuild2/config/operation.cxx @@ -972,7 +972,7 @@ namespace build2 configure_project (a, rs->rw (), c_s, - *rs->find_module<module> (module::name), + *rs->rw ().find_module<module> (module::name), projects); } } @@ -1053,7 +1053,7 @@ namespace build2 } } - if (module* m = rs.find_module<module> (module::name)) + if (const module* m = rs.find_module<module> (module::name)) { for (auto hook: m->disfigure_pre_) r = hook (a, rs) || r; |