-//
-// This implements a cprintf based warn
-//
-void __warn(const std::string&, cp::ArgList &, const char*, const char*, int);
-#define __warn__(format, ...) \
- __warn(format, (*(new cp::ArgList), __VA_ARGS__), \
- __FUNCTION__ , __FILE__, __LINE__)
-#define warn(...) \
- __warn__(__VA_ARGS__, cp::ArgListNull())
-
-// Only print the warning message the first time it is seen. This
-// doesn't check the warning string itself, it just only lets one
-// warning come from the statement. So, even if the arguments change
-// and that would have resulted in a different warning message,
-// subsequent messages would still be supressed.
-#define warn_once(...) do { \
- static bool once = false; \
- if (!once) { \
- __warn__(__VA_ARGS__, cp::ArgListNull()); \
- once = true; \
- } \
+void
+__base_message(std::ostream &stream, const char *prefix, bool verbose,
+ const char *func, const char *file, int line,
+ const char *format, CPRINTF_DECLARATION);
+
+inline void
+__base_message(std::ostream &stream, const char *prefix, bool verbose,
+ const char *func, const char *file, int line,
+ const std::string &format, CPRINTF_DECLARATION)
+{
+ __base_message(stream, prefix, verbose, func, file, line, format.c_str(),
+ VARARGS_ALLARGS);
+}
+
+#define base_message(stream, prefix, verbose, ...) \
+ __base_message(stream, prefix, verbose, __FUNCTION__, __FILE__, __LINE__, \
+ __VA_ARGS__)
+
+// Only print the message the first time this expression is
+// encountered. i.e. This doesn't check the string itself and
+// prevent duplicate strings, this prevents the statement from
+// happening more than once. So, even if the arguments change and that
+// would have resulted in a different message thoes messages would be
+// supressed.
+#define base_message_once(...) do { \
+ static bool once = false; \
+ if (!once) { \
+ base_message(__VA_ARGS__); \
+ once = true; \
+ } \