From aded6de920f420b5c36fee1081c795cf8c6c6dc9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Dec 2015 19:03:08 +0200 Subject: Rely on as few C++14 features as possible --- build/algorithm.cxx | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'build/algorithm.cxx') diff --git a/build/algorithm.cxx b/build/algorithm.cxx index b296929..a2ee7c0 100644 --- a/build/algorithm.cxx +++ b/build/algorithm.cxx @@ -145,12 +145,11 @@ namespace build { auto g ( make_exception_guard ( - [](action a, target& t, const string& n) + [ra, &t, &n]() { info << "while matching rule " << n << " to " - << diag_do (a, t); - }, - ra, t, n)); + << diag_do (ra, t); + })); if (!(m = ru.match (ra, t, hint))) continue; @@ -173,12 +172,11 @@ namespace build { auto g ( make_exception_guard ( - [](action a, target& t, const string& n1) + [ra, &t, &n1]() { info << "while matching rule " << n1 << " to " - << diag_do (a, t); - }, - ra, t, n1)); + << diag_do (ra, t); + })); if (!ru1.match (ra, t, hint)) continue; @@ -203,12 +201,11 @@ namespace build { auto g ( make_exception_guard ( - [](action a, target& t, const string& n) + [ra, &t, &n]() { info << "while applying rule " << n << " to " - << diag_do (a, t); - }, - ra, t, n)); + << diag_do (ra, t); + })); // @@ We could also allow the rule to change the recipe // action in apply(). Could be useful with delegates. @@ -352,12 +349,11 @@ namespace build { auto g ( make_exception_guard ( - [](action a, target& t) + [a, &t]() { t.raw_state = target_state::failed; info << "while " << diag_doing (a, t); - }, - a, t)); + })); target_state ts (t.recipe (a) (a, t)); assert (ts != target_state::unknown && ts != target_state::failed); -- cgit v1.1