]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
Rename NDEBUG to NLOGDEBUG to allow disabling assert()s while keeping logging enabled
authorOndřej Surý <ondrej@sury.org>
Wed, 7 Dec 2016 09:56:56 +0000 (10:56 +0100)
committerOndřej Surý <ondrej@sury.org>
Wed, 7 Dec 2016 09:56:56 +0000 (10:56 +0100)
doc/build.rst
lib/layer.h
lib/layer/iterate.c
lib/resolve.c
lib/utils.h

index 79610f840a541a48e79bf86da018261da43619a0..7ebd6a3e0166e7dfc1387b7c4341d73f1890c0e3 100644 (file)
@@ -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``.
 
index a4725092dfa5bc5b10da80eaa99d5d1ced9cd6f0..ee33d68eae4f6ba9bf139acf9263671077067726 100644 (file)
@@ -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; \
index c90894670ac82fec968b80bf179f681a287b0906..eaf654d9546b97495c4029476675f7e8ea843a0b 100644 (file)
@@ -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
 
index 1819c0f4d62bec9975e1195c21a65f58f3997b1b..1ce7e92cf5389149930967f293704be7a2c620ec 100644 (file)
@@ -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 */
index 83c57677f095b1d20efb47d2dd7a2d802110e58e..385d881cfe4945abf3c026285e8adc9ad4a9b0b2 100644 (file)
@@ -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);