From e3e597180487328a54721e2afb95e33ed853d586 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 1 Feb 2017 16:36:24 +0200 Subject: Pass const scope& where modification should not happen --- build2/b.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'build2/b.cxx') diff --git a/build2/b.cxx b/build2/b.cxx index 341554f..0ad404a 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -52,11 +52,21 @@ using namespace std; #include #include -using namespace build2; +namespace build2 +{ + int + main (int argc, char* argv[]); +} int main (int argc, char* argv[]) { + return build2::main (argc, argv); +} + +int build2:: +main (int argc, char* argv[]) +{ // This is a little hack to make out baseutils for Windows work when called // with absolute path. In a nutshell, MSYS2's exec*p() doesn't search in the // parent's executable directory, only in PATH. And since we are running @@ -563,7 +573,7 @@ main (int argc, char* argv[]) // be of use to the bootstrap files (other than src-root.build, // which, BTW, doesn't need to exist if src_root == out_root). // - scope& rs (create_root (out_root, src_root)); + scope& rs (create_root (*scope::global_, out_root, src_root)); bool bootstrapped (build2::bootstrapped (rs)); @@ -980,7 +990,7 @@ main (int argc, char* argv[]) // building before we know how to for all the targets in this // operation batch. // - scope& bs (scopes.find (ts.out_base)); + const scope& bs (scopes.find (ts.out_base)); // Find the target type and extract the extension. // -- cgit v1.1