Changed debugging to use inline function rather than macro

This commit is contained in:
MarkRivers
2011-09-07 17:30:54 +00:00
parent f46567543d
commit 667fa51e73
+8 -9
View File
@@ -67,17 +67,16 @@ HeadURL: $URL$
/*----------------debugging-----------------*/
#ifdef __GNUG__
#ifdef DEBUG
#define Debug(l, f, args...) {if (l <= motordrvComdebug) printf(f, ## args);}
#else
#define Debug(l, f, args...)
#endif
#else
#define Debug()
#endif
volatile int motordrvComdebug = 0;
extern "C" {epicsExportAddress(int, motordrvComdebug);}
static inline void Debug(int level, const char *format, ...) {
#ifdef DEBUG
va_list pVar;
va_start(pVar, format);
if (level < motordrvComdebug) vprintf(format, pVar);
va_end(pVar);
#endif
}
/* Function declarations. */