apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: Reducing #ifdef burden on APR applications
Date Mon, 22 Aug 2005 12:00:13 GMT
On Monday 22 August 2005 12:13, Joe Orton wrote:

> > OK, I guess what we really want here is an additional return code
> > APR_NOOP. NOTIMPL is inappropriate, and you've raised an objection to
> Why is ENOTIMPL inappropriate?

Erm, because ENOTIMPL is an error, whereas this noop isn't?

> The function is not implemented for the 
> non-threaded build.  If you want to be able to use these functions
> unconditionally then you have to check for SUCCESS or (something) and
> (something) may as well be APR_ENOTIMPL as some new code.
> What's really needed is a feature-detection API along with the ENOTIMPL
> stubs.
>   if (apr_has_feature(APR_FEATURE_THREADS))
>     /* create mutex */

That would also work, but it's more complexity, and looks a bit like
just shifting the #ifdefs away from the precompiler.  I prefer Jeff's
suggestion of tying that kind of thing into startup.  Or APR_NOOP.

Nick Kew

View raw message