slirp: always build with debug statements
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 21 Nov 2018 22:06:36 +0000 (02:06 +0400)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 13 Jan 2019 23:44:29 +0000 (00:44 +0100)
Make debug statements condiitonal only on slirp_debug flags, instead
of the pre-processor DEBUG blocks, as it may introduce breakage
easily, since the debug code isn't always compiled.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
slirp/debug.h
slirp/misc.c

index ca3a4b04dae2c6094d894ab49fe2048e22e531f0..ff920f0b878661428fa6fd35203181f0b86db5fd 100644 (file)
@@ -5,9 +5,8 @@
  * terms and conditions of the copyright.
  */
 
-//#define DEBUG 1
-
-#ifdef DEBUG
+#ifndef DEBUG_H_
+#define DEBUG_H_
 
 #define DBG_CALL 0x1
 #define DBG_MISC 0x2
@@ -50,12 +49,4 @@ extern int slirp_debug;
     }                                           \
 } while (0)
 
-#else
-
-#define DEBUG_CALL(fmt, ...)
-#define DEBUG_ARG(fmt, ...)
-#define DEBUG_ARGS(fmt, ...)
-#define DEBUG_MISC(fmt, ...)
-#define DEBUG_ERROR(fmt, ...)
-
-#endif
+#endif /* DEBUG_H_ */
index 526cefa0f196f3d7dba3a8819a8136b579e05cf7..e30d2ceb2af2f8c6a9fef1d6aeb820085bed242f 100644 (file)
 #include "qemu/main-loop.h"
 
 #ifdef DEBUG
-int slirp_debug = DBG_CALL|DBG_MISC|DBG_ERROR;
+#define SLIRP_DEBUG (DBG_CALL | DBG_MISC | DBG_ERROR)
+#else
+#define SLIRP_DEBUG 0
 #endif
 
+int slirp_debug = SLIRP_DEBUG;
+
 inline void
 insque(void *a, void *b)
 {