Random thoughts:
Your use of __VA_ARGS__
appears to be correct.
The TRACE__LOW
macro adds a superfluous semi-colon to the output (could cause problems for conditional statements that don't have curly braces).
I don't know what COLOR(GREEN)
expands to, so that may be the source of the problem.
Suggestion:
Your compiler should have an option to output the results from the preprocessor. On the compiler I'm using that option is -E. If you have the compiler output the results from the preprocessor, you can see precisely what your macro expands to.
For example, compiling the following code with -E
#include <stdio.h>
#define TRACE__LOW(str, col, ...)\
TR_Trace("\r\e[" COLOR(col) "%s :: %s():%d; LOW - " str "\e[0m\r\n",\
##__VA_ARGS__);
int main( void )
{
TRACE__LOW( "test", 3, a, b, c );
}
produces this output (after about 5 million other lines ;) )
int main( void )
{
TR_Trace("\r\e[" COLOR(3) "%s :: %s():%d; LOW - " "test" "\e[0m\r\n", a, b, c);;
}