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.
This commit is contained in:
Igor Kushnir 2014-09-28 13:16:43 +03:00 committed by Abs62
parent 98b37feac2
commit 1d6b5efeac
2 changed files with 9 additions and 5 deletions

View file

@ -4,11 +4,15 @@
#include <QFile> #include <QFile>
#ifdef NO_CONSOLE #ifdef NO_CONSOLE
#define GD_DPRINTF(...) do {} while( 0 ) #define GD_DPRINTF(...) do {} while( 0 )
#define GD_FDPRINTF(...) do {} while( 0 ) #define GD_FDPRINTF(...) do {} while( 0 )
#else #else
#define GD_DPRINTF(...) printf(__VA_ARGS__) #ifdef NO_GD_DPRINTF
#define GD_FDPRINTF(...) fprintf(__VA_ARGS__) #define GD_DPRINTF(...) do {} while( 0 )
#else
#define GD_DPRINTF(...) printf(__VA_ARGS__)
#endif
#define GD_FDPRINTF(...) fprintf(__VA_ARGS__)
#endif #endif
void gdWarning(const char *, ...) /* print warning message */ void gdWarning(const char *, ...) /* print warning message */

View file

@ -23,7 +23,7 @@ isEmpty( hasGit ) {
} }
CONFIG( release, debug|release ) { CONFIG( release, debug|release ) {
DEFINES += NDEBUG DEFINES += NDEBUG NO_GD_DPRINTF
} }
# DEPENDPATH += . generators # DEPENDPATH += . generators