From a82cdb8fd9ba02034d296769772cdf81244da66a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 20 Apr 2015 13:01:46 +0200 Subject: Automatically decide when to print relative/absolute paths --- build/diagnostics.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'build/diagnostics.cxx') diff --git a/build/diagnostics.cxx b/build/diagnostics.cxx index bc157ed..0dfae1a 100644 --- a/build/diagnostics.cxx +++ b/build/diagnostics.cxx @@ -75,6 +75,10 @@ namespace build return r; } + // Relative stream. + // + const int relative_index = ostream::xalloc (); + // diag_do(), etc. // string @@ -194,6 +198,8 @@ namespace build void simple_prologue_base:: operator() (const diag_record& r) const { + relative (r.os_, relative_); + if (type_ != nullptr) r << type_ << ": "; @@ -204,6 +210,8 @@ namespace build void location_prologue_base:: operator() (const diag_record& r) const { + relative (r.os_, relative_); + r << loc_.file << ':' << loc_.line << ':' << loc_.column << ": "; if (type_ != nullptr) @@ -216,7 +224,6 @@ namespace build const basic_mark error ("error"); const basic_mark warn ("warning"); const basic_mark info ("info"); - const basic_mark text (nullptr); - + const text_mark text; const fail_mark fail; } -- cgit v1.1