mirror of
https://github.com/Binary-Coalescence/motorDSM.git
synced 2025-08-04 21:55:40 -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)
|
#define NINT(f) (long)((f)>0 ? (f)+0.5 : (f)-0.5)
|
||||||
|
|
||||||
#ifdef __GNUG__
|
volatile int devMCB4BDebug = 0;
|
||||||
#ifdef DEBUG
|
extern "C" {epicsExportAddress(int, devMCB4BDebug);}
|
||||||
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
|
|
||||||
|
|
||||||
|
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:
|
/* Debugging levels:
|
||||||
* devMCB4BDebug >= 3 Print new part of command and command string so far
|
* 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 */
|
#define BUFF_SIZE 100 /* Maximum length of string to/from MCB4B */
|
||||||
|
|
||||||
#ifdef __GNUG__
|
volatile int drvMCB4BDebug = 0;
|
||||||
#ifdef DEBUG
|
extern "C" {epicsExportAddress(int, drvMCB4BDebug);}
|
||||||
volatile int drvMCB4BDebug = 0;
|
|
||||||
#define Debug(L, FMT, V...) { if(L <= drvMCB4BDebug) \
|
static inline void Debug(int level, const char *format, ...) {
|
||||||
{ printf("%s(%d):",__FILE__,__LINE__); \
|
#ifdef DEBUG
|
||||||
printf(FMT,##V); } }
|
if (level < drvMCB4BDebug)
|
||||||
#else
|
{
|
||||||
#define Debug(L, FMT, V...)
|
va_list pVar;
|
||||||
#endif
|
va_start(pVar, format);
|
||||||
#else
|
vprintf(format, pVar);
|
||||||
#define Debug()
|
va_end(pVar);
|
||||||
#endif
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* Debugging notes:
|
/* Debugging notes:
|
||||||
* drvMCB4BDebug == 0 No debugging information is printed
|
* drvMCB4BDebug == 0 No debugging information is printed
|
||||||
|
Reference in New Issue
Block a user