From 1d6b5efeac5c1f91ff0db57014ad33dc17d36282 Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Sun, 28 Sep 2014 13:16:43 +0300 Subject: [PATCH] Disable GD_DPRINTF() output in Release builds on all systems Messages printed with GD_DPRINTF() are clearly debug messages. They flood GoldenDict's output with lines like these: some body finished one finished. erasing.. erase done.. one not finished. ====reading 16384 bytes Messages printed to stderr with GD_FDPRINTF() are more important and less frequent => leave them in Release builds. --- gddebug.hh | 12 ++++++++---- goldendict.pro | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gddebug.hh b/gddebug.hh index e8148e0d..cc1f0b74 100644 --- a/gddebug.hh +++ b/gddebug.hh @@ -4,11 +4,15 @@ #include #ifdef NO_CONSOLE -#define GD_DPRINTF(...) do {} while( 0 ) -#define GD_FDPRINTF(...) do {} while( 0 ) + #define GD_DPRINTF(...) do {} while( 0 ) + #define GD_FDPRINTF(...) do {} while( 0 ) #else -#define GD_DPRINTF(...) printf(__VA_ARGS__) -#define GD_FDPRINTF(...) fprintf(__VA_ARGS__) + #ifdef NO_GD_DPRINTF + #define GD_DPRINTF(...) do {} while( 0 ) + #else + #define GD_DPRINTF(...) printf(__VA_ARGS__) + #endif + #define GD_FDPRINTF(...) fprintf(__VA_ARGS__) #endif void gdWarning(const char *, ...) /* print warning message */ diff --git a/goldendict.pro b/goldendict.pro index 241745f6..0f73c93e 100644 --- a/goldendict.pro +++ b/goldendict.pro @@ -23,7 +23,7 @@ isEmpty( hasGit ) { } CONFIG( release, debug|release ) { - DEFINES += NDEBUG + DEFINES += NDEBUG NO_GD_DPRINTF } # DEPENDPATH += . generators