From 557269660c1d9796a7cf9e911efb9262f645e359 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 22 Nov 2016 12:10:03 +0200 Subject: Use diagnostics facility from libbutl --- build2/utility.cxx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'build2/utility.cxx') diff --git a/build2/utility.cxx b/build2/utility.cxx index 5d65f7b..e4b5254 100644 --- a/build2/utility.cxx +++ b/build2/utility.cxx @@ -15,23 +15,27 @@ using namespace std; -namespace build2 -{ - // - // - // +// +// +// +namespace std +{ ostream& - operator<< (ostream& os, const path& p) + operator<< (ostream& os, const ::butl::path& p) { + using namespace build2; + return os << (stream_verb (os) < 2 ? diag_relative (p) : p.representation ()); } ostream& - operator<< (ostream& os, const process_path& p) + operator<< (ostream& os, const ::butl::process_path& p) { + using namespace build2; + if (p.empty ()) os << ""; else @@ -47,7 +51,10 @@ namespace build2 return os; } +} +namespace build2 +{ // // // @@ -153,8 +160,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << args0 << ": " << e.what (); - throw failed (); + fail << "unable to execute " << args0 << ": " << e.what () << endf; } process_path @@ -165,8 +171,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << f << ": " << e.what (); - throw failed (); + fail << "unable to execute " << f << ": " << e.what () << endf; } process @@ -191,9 +196,7 @@ namespace build2 exit (1); } else - error << "unable to execute " << args[0] << ": " << e.what (); - - throw failed (); + fail << "unable to execute " << args[0] << ": " << e.what () << endf; } } @@ -222,8 +225,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << args[0] << ": " << e.what (); - throw failed (); + fail << "unable to execute " << args[0] << ": " << e.what () << endf; } const string empty_string; @@ -504,8 +506,6 @@ namespace build2 return r; } - bool exception_unwinding_dtor = false; - void init (const char* a0, uint16_t v) { -- cgit v1.1