A macro is a #define that takes parameters. For example, this macro
Code:
#define debug_str(string, line, file) \
fprintf(stderr, "%s:%i: %s\n", file, line, string)
takes three parameters.
Those parameters can be used in the macro, but they don't have to be. In your case, the macro
Code:
#define PrintDebuggingText(ignore)
is defined when DEBUGGING_TEXT_ON is false. What's it defined as? It's defined as nothing. In this case, the PrintDebuggingText macro is replaced with nothing (presumably, to eliminate the debugging messages).
[edit] In case I wasn't clear: that "ignore" is like an unused parameter. It could be called anything, because it isn't used. I guess "ignore" is as good a name as any. [/edit]
The problem here is that this
Code:
extern int PrintDebuggingText(const char* t, ...);
takes one parameter followed by zero or more parameters, probably printf-style, whereas this
Code:
#define PrintDebuggingText(ignore)
only takes one parameter.
The easiest way to fix this is to make the second maco also take the same parameters, i.e.
Code:
#define PrintDebuggingText(ignore, ...)
Unfortunately, that code is C99-only. If you're okay with that, fine.
Otherwise, you might consider creating a dummy function like this:
Code:
#if DEBUGGING_TEXT_ON
extern int PrintDebuggingText(const char* t, ...);
#else
int PrintDebuggingText(const char* t, ...) {
return 0;
}
#endif
Also: I wouldn't use that PrintDebuggingText() function anyway. fprintf(stderr, ...) works just fine.