summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d98fb1)
raw | patch | inline | side by side (parent: 7d98fb1)
author | Max Kellermann <max@duempel.org> | |
Mon, 15 Sep 2008 10:27:28 +0000 (12:27 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 15 Sep 2008 10:27:28 +0000 (12:27 +0200) |
NDEBUG is more commonly used than DEBUG, e.g. in assert.h. Convert
all macros to NDEBUG, and declare NDEBUG when debugging is disabled.
all macros to NDEBUG, and declare NDEBUG when debugging is disabled.
configure.ac | patch | blob | history | |
src/main.c | patch | blob | history | |
src/mpdclient.c | patch | blob | history | |
src/ncmpc.h | patch | blob | history | |
src/options.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 16a13571d1c0dba76dc1ce49d633516e56217db8..dc6a413510e0196a99803fc448ba751a038db8c7 100644 (file)
--- a/configure.ac
+++ b/configure.ac
[enable_debug=no])
AC_MSG_RESULT([$enable_debug])
if test "x$enable_debug" = "xyes" ; then
- CFLAGS="$CFLAGS -g -DDEBUG"
+ CFLAGS="$CFLAGS -g"
+else
+ CFLAGS="$CFLAGS -DNDEBUG"
fi
dnl CFLAGS
diff --git a/src/main.c b/src/main.c
index c2c7170eb7477461d36fdf92bc4a757c21d3102a..1d93b69fc524364dfa9398fef5518201398efa6a 100644 (file)
--- a/src/main.c
+++ b/src/main.c
kill(0, SIGSTOP); /* issue SIGSTOP */
}
-#ifdef DEBUG
+#ifndef NDEBUG
void
D(char *format, ...)
{
diff --git a/src/mpdclient.c b/src/mpdclient.c
index cc31f9ca548ffe38fa5bed2d6a670849ba41bae2..9f060c46d4834535e26eb979a34044b43dbea0ee 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
return error;
}
-#ifdef DEBUG
+#ifndef NDEBUG
// Unused ath the moment
/*
#include "strfsong.h"
c->status = mpd_getStatus(c->connection);
if( (retval=mpdclient_finish_command(c)) )
return retval;
-#ifdef DEBUG
+#ifndef NDEBUG
if( c->status->error )
D("status> %s\n", c->status->error);
#endif
diff --git a/src/ncmpc.h b/src/ncmpc.h
index 7d000958d358dd12cd8522a99acd5ac46074438a..033145f916239f69f73ff7b4e4569d5b60dde990 100644 (file)
--- a/src/ncmpc.h
+++ b/src/ncmpc.h
#define ENABLE_LYRICS_SCREEN 1
#endif
-#ifdef DEBUG
+#ifndef NDEBUG
void D(char *format, ...);
#else
#define D(...)
diff --git a/src/options.c b/src/options.c
index 60101c478a6369a2fc5334fd49c81db181b6eb43..1ecc791034eb490cf31173b53850912bba83077b 100644 (file)
--- a/src/options.c
+++ b/src/options.c
{ 'f', "config", "FILE", "Read configuration from file" },
{ 'k', "key-file","FILE", "Read configuration from file" },
{ 'S', "no-splash", NULL, "Don't show the splash screen" },
-#ifdef DEBUG
+#ifndef NDEBUG
{ 'K', "dump-keys", NULL, "Dump key bindings to stdout" },
{ 'D', "debug", NULL, "Enable debug output on stderr" },
#endif
case 'V': /* --version */
printf("%s version: %s\n", PACKAGE, VERSION);
printf("build options:");
-#ifdef DEBUG
+#ifndef NDEBUG
printf(" debug");
#endif
#ifdef ENABLE_NLS
case 'S': /* --key-file */
/* the splash screen was removed */
break;
-#ifdef DEBUG
+#ifndef NDEBUG
case 'K': /* --dump-keys */
read_configuration(&options);
write_key_bindings(stdout, KEYDEF_WRITE_ALL | KEYDEF_COMMENT_ALL);