>From 236c82fee189c22b88313fda71816e486edab8a6 Mon Sep 17 00:00:00 2001 From: Danil Antonov <g.danil.a...@gmail.com> Date: Wed, 29 Mar 2017 12:23:58 +0300 Subject: [PATCH 09/43] ppc: made printf always compile in debug output
Wrapped printf calls inside debug macros (DPRINTF) in `if` statement. This will ensure that printf function will always compile even if debug output is turned off and, in turn, will prevent bitrot of the format strings. Signed-off-by: Danil Antonov <g.danil.a...@gmail.com> --- target/ppc/kvm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 9f1f132..5425055 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -50,15 +50,15 @@ #include "hw/ppc/spapr_cpu_core.h" #endif -//#define DEBUG_KVM - -#ifdef DEBUG_KVM -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) -#endif +#ifndef DEBUG_KVM +#define DEBUG_KVM 0 +#endif + +#define DPRINTF(fmt, ...) do { \ + if (DEBUG_KVM) { \ + fprintf(stderr, fmt, ## __VA_ARGS__); \ + } \ +} while (0); #define PROC_DEVTREE_CPU "/proc/device-tree/cpus/" -- 2.8.0.rc3