mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
make various dprintf macros safer for general usage
This commit is contained in:
@@ -39,7 +39,11 @@ enum
|
|||||||
|
|
||||||
void setDebugLevel( int level );
|
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);}
|
#define dperror(str) {perror("[neutrino] " str);}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -28,7 +28,11 @@
|
|||||||
|
|
||||||
extern int timerd_debug;
|
extern int timerd_debug;
|
||||||
|
|
||||||
#define dprintf(fmt, args...) {if(timerd_debug) printf( "[timerd] " fmt, ## args);}
|
#define dprintf(fmt, args...) \
|
||||||
|
do { \
|
||||||
|
if(timerd_debug) \
|
||||||
|
printf( "[timerd] " fmt, ## args); \
|
||||||
|
} while(0)
|
||||||
#define dperror(str) {perror("[timerd] " str);}
|
#define dperror(str) {perror("[timerd] " str);}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user