summaryrefslogtreecommitdiff
path: root/src/error.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-26 05:30:48 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-26 05:30:48 -0400
commitbadea0058402837961125bd000ced2a132591cbf (patch)
tree4873746732a154c152a99bdda968c626526ff5e0 /src/error.h
parent87ec7bc34a78ae67101514d6507b90fe691e0010 (diff)
downloadfork-ledger-badea0058402837961125bd000ced2a132591cbf.tar.gz
fork-ledger-badea0058402837961125bd000ced2a132591cbf.tar.bz2
fork-ledger-badea0058402837961125bd000ced2a132591cbf.zip
Added a warning_() macro
Diffstat (limited to 'src/error.h')
-rw-r--r--src/error.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/error.h b/src/error.h
index 1b4c7e12..45c0cc68 100644
--- a/src/error.h
+++ b/src/error.h
@@ -64,6 +64,16 @@ inline void throw_func(const string& message) {
_desc_accum.clear(), \
throw_func<cls>(_desc_buffer.str()))
+inline void warning_func(const string& message) {
+ std::cerr << "Warning: " << message << std::endl;
+ _desc_buffer.str("");
+}
+
+#define warning_(msg) \
+ ((_desc_buffer << ACCUM(_desc_accum << msg)), \
+ _desc_accum.clear(), \
+ warning_func(_desc_buffer.str()))
+
extern straccstream _ctxt_accum;
extern std::ostringstream _ctxt_buffer;