make various dprintf macros safer for general usage

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
Stefan Seyfried
2016-01-04 21:07:02 +01:00
committed by svenhoefer
parent 20bf0b00d8
commit 9c2d9c8a25
2 changed files with 10 additions and 2 deletions

View File

@@ -39,7 +39,11 @@ enum
void setDebugLevel( int level );
#define dprintf(debuglevel, fmt, args...) {if(debug>=debuglevel) printf( "[neutrino] " fmt, ## args);}
#define dprintf(debuglevel, fmt, args...) \
do { \
if (debug >= debuglevel) \
printf( "[neutrino] " fmt, ## args); \
} while(0)
#define dperror(str) {perror("[neutrino] " str);}