From 457f65414031f45174f3c35230a0c0e1de88b51a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 Apr 2022 04:39:45 +0200 Subject: Switch to using std::function for target::data_pad --- libbuild2/config/functions.cxx | 5 ++++- libbuild2/config/operation.cxx | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'libbuild2/config') 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::name)); + // See save_config() for details. + // + assert (s->ctx.phase == run_phase::load); + module* mod (s->rw ().find_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::name), + *rs->rw ().find_module (module::name), projects); } } @@ -1053,7 +1053,7 @@ namespace build2 } } - if (module* m = rs.find_module (module::name)) + if (const module* m = rs.find_module (module::name)) { for (auto hook: m->disfigure_pre_) r = hook (a, rs) || r; -- cgit v1.1