From 1c515ff7791fd186dc82e80134ac47273c43d442 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Sat, 3 Jul 2004 13:21:26 +0000 Subject: [PATCH] Replaced the debug macro with a function git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1780 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- configure.ac | 2 +- src/main.c | 18 ++++++++++++++++++ src/ncmpc.h | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 4782abb..9a6b8e3 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ dnl AC_INIT AC_CONFIG_SRCDIR([src/main.c]) -AM_INIT_AUTOMAKE(ncmpc, 0.11.0-svn-20040630) +AM_INIT_AUTOMAKE(ncmpc, 0.11.0-svn) AM_CONFIG_HEADER([config.h]) dnl Check for programs diff --git a/src/main.c b/src/main.c index 2ace297..abe60bf 100644 --- a/src/main.c +++ b/src/main.c @@ -133,6 +133,24 @@ catch_sigint( int sig ) exit(EXIT_SUCCESS); } +#ifdef DEBUG +void +D(char *format, ...) +{ + if( options.debug ) + { + gchar *msg; + va_list ap; + + va_start(ap,format); + msg = g_strdup_vprintf(format,ap); + va_end(ap); + fprintf(stderr, "%s", msg); + g_free(msg); + } +} +#endif + int main(int argc, const char *argv[]) { diff --git a/src/ncmpc.h b/src/ncmpc.h index 029498f..4118456 100644 --- a/src/ncmpc.h +++ b/src/ncmpc.h @@ -6,7 +6,7 @@ #endif #ifdef DEBUG -#define D(format, args...) fprintf(stderr, format, ##args) +void D(char *format, ...); #else #define D(...) #endif -- 2.30.2