From badea0058402837961125bd000ced2a132591cbf Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 26 Feb 2009 05:30:48 -0400 Subject: Added a warning_() macro --- src/error.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/error.h') 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(_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; -- cgit v1.2.3