SNDDBG

Corona688 tsm at accesscomm.ca
Thu Aug 22 17:44:17 EDT 2002


In my quest to get an actual -*CONSOLE OUPTUT*- on my Ipaq, I've had to
redirect stdout thru the Ipaq's serial port, to Telix on my comp.  What
does this have to do with SNDDBG?  Glad you asked.

For quite some time, I struggled trying to get the Ipaq to spew debug
info to my modem window, then figured it must be printf that's causing
the problem, might still be printing to the old stdout.  Searched thru
Google Groups for a good way to get a debug macro that works with
fprintf and variable arguments, and bodged it in - still nothing.  Then
I realized, I was linking to the release DLLs, not the debug ones.
Switch that and it works unmodified.  Oh well.

Not all for nothing, tho.. I believe the macro I found is better than
the one we've got currently.  Gets rid of those annoying double
brackets, and lets us redirect it wheverer we want..  here's how it
works, and how it looks:

#if (defined DEBUG_CHATTER)
#define Arg(X) ,(X)
#define SNDDBG(argument)  fprintf(stderr, argument)
#else
#define SNDDBG(x)
#endif

SNDDBG("Number %d Float %f" Arg(some_int) Arg(some_float));

Yup, no commas between the strings and Args.  That's the only odd thing
about it.




More information about the sdlsound mailing list