diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-25 16:17:50 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-25 16:17:50 +0200 |
commit | c4af692746181b5bb0ac50489555341feefd943c (patch) | |
tree | b8d90577668165489e7848ed38b4f19ed4cf8ba6 /odb/error.cxx | |
parent | 1a6a0652a6ef5b319cfc8ad05a0acee6910f7560 (diff) |
Use out own diagnostic functions to avoid bogus location context
Diffstat (limited to 'odb/error.cxx')
-rw-r--r-- | odb/error.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/odb/error.cxx b/odb/error.cxx new file mode 100644 index 0000000..649efce --- /dev/null +++ b/odb/error.cxx @@ -0,0 +1,29 @@ +// file : odb/error.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v3; see accompanying LICENSE file + +#include <iostream> + +#include <odb/error.hxx> + +using namespace std; + +std::ostream& +error (cutl::fs::path const& p, size_t line, size_t clmn) +{ + errorcount++; + cerr << p << ':' << line << ':' << clmn << ": error: "; + return cerr; +} + +std::ostream& +error (location_t loc) +{ + errorcount++; + cerr << LOCATION_FILE (loc) << ':' + << LOCATION_LINE (loc) << ':' + << LOCATION_COLUMN (loc) << ':' + << " error: "; + return cerr; +} |