mirror of
https://github.com/Binary-Coalescence/motorDSM.git
synced 2025-08-05 14:15:39 -05:00
Changed diagnostic message macro 'Debug' to Mark Rivers inline variable argument function calls.
This commit is contained in:
@@ -29,19 +29,20 @@ extern struct driver_table MCB4B_access;
|
||||
|
||||
#define NINT(f) (long)((f)>0 ? (f)+0.5 : (f)-0.5)
|
||||
|
||||
#ifdef __GNUG__
|
||||
#ifdef DEBUG
|
||||
volatile int devMCB4BDebug = 0;
|
||||
#define Debug(L, FMT, V...) { if(L <= devMCB4BDebug) \
|
||||
{ errlogPrintf("%s(%d):",__FILE__,__LINE__); \
|
||||
errlogPrintf(FMT,##V); } }
|
||||
#else
|
||||
#define Debug(L, FMT, V...)
|
||||
#endif
|
||||
#else
|
||||
#define Debug()
|
||||
#endif
|
||||
volatile int devMCB4BDebug = 0;
|
||||
extern "C" {epicsExportAddress(int, devMCB4BDebug);}
|
||||
|
||||
static inline void Debug(int level, const char *format, ...) {
|
||||
#ifdef DEBUG
|
||||
if (level < devMCB4BDebug)
|
||||
{
|
||||
va_list pVar;
|
||||
va_start(pVar, format);
|
||||
vprintf(format, pVar);
|
||||
va_end(pVar);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Debugging levels:
|
||||
* devMCB4BDebug >= 3 Print new part of command and command string so far
|
||||
|
@@ -35,18 +35,20 @@
|
||||
|
||||
#define BUFF_SIZE 100 /* Maximum length of string to/from MCB4B */
|
||||
|
||||
#ifdef __GNUG__
|
||||
#ifdef DEBUG
|
||||
volatile int drvMCB4BDebug = 0;
|
||||
#define Debug(L, FMT, V...) { if(L <= drvMCB4BDebug) \
|
||||
{ printf("%s(%d):",__FILE__,__LINE__); \
|
||||
printf(FMT,##V); } }
|
||||
#else
|
||||
#define Debug(L, FMT, V...)
|
||||
#endif
|
||||
#else
|
||||
#define Debug()
|
||||
#endif
|
||||
volatile int drvMCB4BDebug = 0;
|
||||
extern "C" {epicsExportAddress(int, drvMCB4BDebug);}
|
||||
|
||||
static inline void Debug(int level, const char *format, ...) {
|
||||
#ifdef DEBUG
|
||||
if (level < drvMCB4BDebug)
|
||||
{
|
||||
va_list pVar;
|
||||
va_start(pVar, format);
|
||||
vprintf(format, pVar);
|
||||
va_end(pVar);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Debugging notes:
|
||||
* drvMCB4BDebug == 0 No debugging information is printed
|
||||
|
Reference in New Issue
Block a user