Prior to C99, which makes this easier, you have to use the double parentheses trick.
Code:
#include <stdio.h>
#include <stdarg.h>
#if defined( DEBUG ) && defined( ANSI )
void DTRACE_fn ( int level, const char* fmt, ... );
# define DTRACE( a ) DTRACE_fn a
#else
# define DTRACE( a )
#endif
void DTRACE_fn ( int level, const char* fmt, ... ) {
char temp[1000];
va_list args;
va_start( args, fmt );
vsprintf( temp, fmt, args );
printf("T: %s\n", temp );
va_end( args );
}
int main ( void ) {
DTRACE((1,"Hello %s","world"));
return 0;
}
The extra ( ) make it look like a single parameter to the macro, even though it has embedded commas.