From: Ondřej Surý Date: Wed, 7 Dec 2016 09:56:56 +0000 (+0100) Subject: Rename NDEBUG to NLOGDEBUG to allow disabling assert()s while keeping logging enabled X-Git-Tag: v1.2.0-rc1~64^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07ef0d92bd43638d65627a6cada7446400b9f165;p=thirdparty%2Fknot-resolver.git Rename NDEBUG to NLOGDEBUG to allow disabling assert()s while keeping logging enabled --- diff --git a/doc/build.rst b/doc/build.rst index 79610f840..7ebd6a3e0 100644 --- a/doc/build.rst +++ b/doc/build.rst @@ -100,7 +100,7 @@ When you have all the dependencies ready, you can build and install. $ make PREFIX="/usr/local" $ make install PREFIX="/usr/local" -.. note:: Always build with ``PREFIX`` if you want to install, as it is hardcoded in the executable for module search path. If you build the binary with ``-DNDEBUG``, verbose logging will be disabled as well. +.. note:: Always build with ``PREFIX`` if you want to install, as it is hardcoded in the executable for module search path. If you build the binary with ``-DNLOGDEBUG``, verbose logging will be disabled as well. Alternatively you can build only specific parts of the project, i.e. ``library``. diff --git a/lib/layer.h b/lib/layer.h index a4725092d..ee33d68ea 100644 --- a/lib/layer.h +++ b/lib/layer.h @@ -19,7 +19,7 @@ #include "lib/defines.h" #include "lib/utils.h" -#ifndef NDEBUG +#ifndef NLOGDEBUG /** @internal Print a debug message related to resolution. */ #define QRDEBUG(query, cls, fmt, ...) do { \ unsigned _ind = 0; \ diff --git a/lib/layer/iterate.c b/lib/layer/iterate.c index c90894670..eaf654d95 100644 --- a/lib/layer/iterate.c +++ b/lib/layer/iterate.c @@ -616,7 +616,7 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt) return KR_STATE_CONSUME; } -#ifndef NDEBUG +#ifndef NLOGDEBUG const knot_lookup_t *rcode = knot_lookup_by_id(knot_rcode_names, knot_wire_get_rcode(pkt->wire)); #endif diff --git a/lib/resolve.c b/lib/resolve.c index 1819c0f4d..1ce7e92cf 100644 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -1032,7 +1032,7 @@ int kr_resolve_checkout(struct kr_request *request, struct sockaddr *src, int kr_resolve_finish(struct kr_request *request, int state) { -#ifndef NDEBUG +#ifndef NLOGDEBUG struct kr_rplan *rplan = &request->rplan; #endif /* Finalize answer */ diff --git a/lib/utils.h b/lib/utils.h index 83c57677f..385d881cf 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -31,7 +31,7 @@ */ #define kr_log_info(fmt, ...) do { printf((fmt), ## __VA_ARGS__); fflush(stdout); } while(0) #define kr_log_error(fmt, ...) fprintf(stderr, (fmt), ## __VA_ARGS__) -#ifndef NDEBUG +#ifndef NLOGDEBUG /* Toggle debug messages */ KR_EXPORT bool kr_debug_set(bool status); KR_EXPORT KR_PURE bool kr_debug_status(void);