Modify debug macros to have the same format through the codebase and use regular ifs instead of ifdef.
As the debug printf is always put in code, some casting had to be added to avoid warnings treated as errors at compile time. Signed-off-by: Marc Marí <marc.mari.barc...@gmail.com> --- hw/net/xgmac.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c index 88349ac..734c2e5 100644 --- a/hw/net/xgmac.c +++ b/hw/net/xgmac.c @@ -30,14 +30,16 @@ #include "net/net.h" #include "net/checksum.h" +//#define DEBUG_XGMAC + #ifdef DEBUG_XGMAC -#define DEBUGF_BRK(message, args...) do { \ - fprintf(stderr, (message), ## args); \ - } while (0) +#define DEBUG_XGMAC_ENABLED 1 #else -#define DEBUGF_BRK(message, args...) do { } while (0) +#define DEBUG_XGMAC_ENABLED 0 #endif +#define DEBUGF_BRK(message, args...) QEMU_DPRINTF(DEBUG_XGMAC_ENABLED, "xgmag", message, ## args) + #define XGMAC_CONTROL 0x00000000 /* MAC Configuration */ #define XGMAC_FRAME_FILTER 0x00000001 /* MAC Frame Filter */ #define XGMAC_FLOW_CTRL 0x00000006 /* MAC Flow Control */ -- 1.7.10.4