httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: nice try, no cigar
Date Sat, 08 Jun 1996 16:48:40 GMT
  I believe he was trying to create a version of an Explain macro that would
  take printf-style parameters

Ah.  Yes, that is trickier.  I guess there's the old doubled-parens trick:

  #ifndef NDEBUG
  #define EXPLAIN(x) _explain x
  void _explain (int level, const char* fmt, ...);
  #else
  #define EXPLAIN(x) /* nothing */
  #endif

  ...

  EXPLAIN((WARN_LEVEL, "leaky faucet, %f drips/minute", drip_rate));

but it's ugly, and besides, it doesn't sneak in __LINE__ and __FILE__.
Hmmm...

rst

Mime
View raw message