summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-12-20 19:24:46 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-12-20 20:30:37 +0100
commitab23b2d884b7eafc8bd17baa818102f14d165e5e (patch)
tree11d5583a68507baa078db275d69884eba4de4071
parentfe2bf66390e67cdb54c0a8e455689258e6fa4ef2 (diff)
downloadcrawl-ref-ab23b2d884b7eafc8bd17baa818102f14d165e5e.tar.gz
crawl-ref-ab23b2d884b7eafc8bd17baa818102f14d165e5e.zip
dprf(...), does same as mprf(MSGCH_DIAGNOSTICS, ...) in debug builds, nothing otherwise.
-rw-r--r--crawl-ref/source/message.cc10
-rw-r--r--crawl-ref/source/mpr.h7
2 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc
index c2fce04242..6a3d36c487 100644
--- a/crawl-ref/source/message.cc
+++ b/crawl-ref/source/message.cc
@@ -446,6 +446,16 @@ void mprf( const char *format, ... )
va_end( argp );
}
+#ifdef DEBUG_DIAGNOSTICS
+void dprf( const char *format, ... )
+{
+ va_list argp;
+ va_start( argp, format );
+ do_message_print( MSGCH_DIAGNOSTICS, 0, format, argp );
+ va_end( argp );
+}
+#endif
+
static bool _updating_view = false;
void mpr(const char *inf, msg_channel_type channel, int param)
diff --git a/crawl-ref/source/mpr.h b/crawl-ref/source/mpr.h
index e2eb48451d..5676e5d197 100644
--- a/crawl-ref/source/mpr.h
+++ b/crawl-ref/source/mpr.h
@@ -77,4 +77,11 @@ void mprf( msg_channel_type channel, int param, const char *format, ... );
void mprf( msg_channel_type channel, const char *format, ... );
void mprf( const char *format, ... );
+// Yay for C89 and lack of variadic #defines...
+#ifdef DEBUG_DIAGNOSTICS
+void dprf( const char *format, ... );
+#else
+static inline void dprf( const char *format, ... ) {}
+#endif
+
#endif