I guess this is probably somewhat off-topic, but I'm hoping someone here can point me in the right direction. I apologize in advance if this is too off-topic - feel free to take the conversation off the list if need be.
I have a function: LogTrace(char *format, ...); that is used for tracing. For potential performance reasons in production my boss wants the option to remove these calls entirely. I'd like to provide an autoconf option --without-tracing that would build a version of my program with these calls removed, but I'm running into a brick wall (possibly of my own making). My initial guess was something like this: #ifdef WITHOUT_TRACING #define LogTrace #endif However, that definition will turn this: LogTrace("%s", variable); into this: ("%s", variable); which doesn't seem like a good idea although it does seem to compile at least some of the time. Anyone have any suggestions on a better way to do this? Just an example of a package which does something similar would be a great starting point. I'm doing all of this work in ANSI C. Thanks, and again, I'm sorry if this is too off-topic. KEN -- Kenneth J. Pronovici <[EMAIL PROTECTED]> Personal Homepage: http://www.skyjammer.com/~pronovic/ "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin, Historical Review of Pennsylvania, 1759
msg06475/pgp00000.pgp
Description: PGP signature