[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

APR_POOL_DEBUG: minor bug

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-10-29 23:12:13 CET

In apr/include/apr_pools.h:

 * When no debug level was specified, assume general debug mode.
 * If level 0 was specified, debugging is switched off
 * </pre>
 */
#if defined(APR_POOL_DEBUG)
#if (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0)
#undef APR_POOL_DEBUG
#define APR_POOL_DEBUG 1
#endif
#else
#define APR_POOL_DEBUG 0
#endif

The second #if is trying to say "if APR_POOL_DEBUG is blank" but it doesn't work: if it is blank, then the preprocessor complains with "operator '!=' has no left operand" (GCC 3.2).

#if (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0)

I think the following is one correct solution:

#if (APR_POOL_DEBUG - APR_POOL_DEBUG - 1) == +1
/* If APR_POOL_DEBUG is blank, we get +1; if it is a number, we get -1. */

(Of course there is a simple way to work around the bug: just use
  #define APR_POOL_DEBUG=1
instead of
  #define APR_POOL_DEBUG
)

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 29 23:12:10 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.