[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Removing function calls (potentially OT)
From: |
Kenneth Pronovici |
Subject: |
Removing function calls (potentially OT) |
Date: |
Mon, 7 Jan 2002 14:03:07 -0600 |
User-agent: |
Mutt/1.2.5i |
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 <address@hidden>
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
pgpV2ioMJYu14.pgp
Description: PGP signature
- Removing function calls (potentially OT),
Kenneth Pronovici <=