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

Re: svn commit: r8341 - trunk/subversion/libsvn_subr

From: Jani Averbach <jaa_at_jaa.iki.fi>
Date: 2004-01-16 19:30:04 CET

On 2004-01-16 11:59-0600, djh@tigris.org wrote:

Sorry about jumping to topic in this late phase, but:

> +#define WIN32_RETRY_LOOP(err, expr) \
> + { \
> + int retries = 0; \
> + int sleep_count = 1000; \
> + \
> + for ( retries = 0; \
> + APR_TO_OS_ERROR (err) == ERROR_ACCESS_DENIED && retries < 100; \
> + ++retries ) \
> + { \
> + apr_sleep (sleep_count); \
> + if (sleep_count < 128000) \
> + sleep_count *= 2; \
> + err = expr; \
> + } \
> + }

I think it is better to use construction:

#ifdef WIN32
#define WIN32_RETRY_LOOP(err, expr) \
    do { \
      ... \
    while(0)
#else
#define WIN32_RETRY_LOOP(err, expr) do {} while(0)
#endif

when you are doing function-like macros. This way the execution path of
program won't change by this macro.

BR, Jani

-- 
Jani Averbach
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 16 19:30:39 2004

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.