]> git.meshlink.io Git - utcp/commitdiff
Only log debug messages in test program when UTCP_DEBUG is defined.
authorGuus Sliepen <guus@meshlink.io>
Sun, 15 Nov 2015 19:35:30 +0000 (20:35 +0100)
committerGuus Sliepen <guus@sliepen.org>
Sun, 2 Jul 2017 10:15:23 +0000 (12:15 +0200)
test.c

diff --git a/test.c b/test.c
index a078e1f9584ab756db68ef0357a17ba051aa314b..81244f90027819f5a456027c390f5a48ecd5a1ac 100644 (file)
--- a/test.c
+++ b/test.c
@@ -35,6 +35,7 @@ char *reorder_data;
 size_t reorder_len;
 int reorder_countdown;
 
+#if UTCP_DEBUG
 void debug(const char *format, ...) {
        struct timeval now;
        gettimeofday(&now, NULL);
@@ -44,6 +45,9 @@ void debug(const char *format, ...) {
        vfprintf(stderr, format, ap);
        va_end(ap);
 }
+#else
+#define debug(...)
+#endif
 
 ssize_t do_recv(struct utcp_connection *c, const void *data, size_t len) {
        if(!data || !len) {