From a491da41f46b5633444732d7822087d5d30f6f9c Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Tue, 29 Nov 2011 21:52:25 +0000 Subject: [PATCH] Changed diagnostic message macro 'Debug' to Mark Rivers inline variable argument function calls. --- motorApp/PiSrc/drvPIC848.cc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/motorApp/PiSrc/drvPIC848.cc b/motorApp/PiSrc/drvPIC848.cc index e735a28c..5a892450 100644 --- a/motorApp/PiSrc/drvPIC848.cc +++ b/motorApp/PiSrc/drvPIC848.cc @@ -3,9 +3,10 @@ FILENAME... drvPIC848.cc USAGE... Motor record driver level support for Physik Instrumente (PI) GmbH & Co. C-848 motor controller. -Version: $Revision: 1.3 $ -Modified By: $Author: sluiter $ -Last Modified: $Date: 2007-10-17 19:55:42 $ +Version: $Revision$ +Modified By: $Author$ +Last Modified: $Date$ +HeadURL: $URL$ */ /* @@ -61,17 +62,18 @@ DESIGN LIMITATIONS... #define BUFF_SIZE 100 /* Maximum length of string to/from PIC848 */ /*----------------debugging-----------------*/ -#ifdef __GNUG__ - #ifdef DEBUG - #define Debug(l, f, args...) { if(l<=drvPIC848debug) printf(f,## args); } - #else - #define Debug(l, f, args...) - #endif -#else - #define Debug() -#endif volatile int drvPIC848debug = 0; extern "C" {epicsExportAddress(int, drvPIC848debug);} +static inline void Debug(int level, const char *format, ...) { + #ifdef DEBUG + if (level < drvPIC848debug) { + va_list pVar; + va_start(pVar, format); + vprintf(format, pVar); + va_end(pVar); + } + #endif +} /* --- Local data. --- */ int PIC848_num_cards = 0;