From 593fd960891027b97567b2622ed4b6c16070ab36 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 28 Apr 2017 08:33:42 +0200 Subject: Implement support for pre-processing version headers (or other files) Also implement the build system version check. --- build2/algorithm.ixx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'build2/algorithm.ixx') diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx index d39bf9c..46dece4 100644 --- a/build2/algorithm.ixx +++ b/build2/algorithm.ixx @@ -361,44 +361,46 @@ namespace build2 // If the first argument is NULL, then the result is treated as a boolean // value. // - pair + pair, const target*> execute_prerequisites (const target_type*, action, const target&, const timestamp&, const prerequisite_filter&); - inline pair + inline optional execute_prerequisites (action a, const target& t, const timestamp& mt, const prerequisite_filter& pf) { - auto p (execute_prerequisites (nullptr, a, t, mt, pf)); - return make_pair (p.first != nullptr, p.second); + return execute_prerequisites (nullptr, a, t, mt, pf).first; } template - inline pair + inline pair, const T&> execute_prerequisites (action a, const target& t, const timestamp& mt, const prerequisite_filter& pf) { auto p (execute_prerequisites (T::static_type, a, t, mt, pf)); - return make_pair (static_cast (p.first), p.second); + return pair, const T&> ( + p.first, static_cast (p.second)); } - inline pair + inline pair, const target&> execute_prerequisites (const target_type& tt, action a, const target& t, const timestamp& mt, const prerequisite_filter& pf) { - return execute_prerequisites (&tt, a, t, mt, pf); + auto p (execute_prerequisites (&tt, a, t, mt, pf)); + return pair, const target&> (p.first, *p.second); } template - inline pair + inline pair, const T&> execute_prerequisites (const target_type& tt, action a, const target& t, const timestamp& mt, const prerequisite_filter& pf) { auto p (execute_prerequisites (tt, a, t, mt, pf)); - return make_pair (static_cast (p.first), p.second); + return pair, const T&> ( + p.first, static_cast (p.second)); } inline target_state -- cgit v1.1