diff options
-rw-r--r-- | crawl-ref/source/message.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/mpr.h | 7 |
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 |