Hey DA,
I use somethin' like this as standard debug macro...Just have a look:
Code:
#include <stdarg.h>
#define __DEBUGTRACE__ ENABLED
#ifdef __DEBUGTRACE__
static void DEBUG_TRACE (FILE *poStream, const char *pccMsg, ...)
{
if (pccMsg != 0)
{
va_list oArgs;
if (!poStream)
{
poStream = stderr;
};
va_start (oArgs, pccMsg);
fprintf (poStream, "DEBUG_MSG> ");
vfprintf (poStream, pccMsg, oArgs);
va_end (oArgs);
};
}
#else
//
// if not in DEBUG mode, make DEBUG_TRACE an empty function,
// that doesn't do anything.
//
static inline void DEBUG_TRACE (FILE*, const char*, ...) { }
#endif
enjoy!
cody
[ EDIT: Sorry, forgot to mention which library you need ]