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 Sat, 20 Aug 2005 13:54:25 GMT
Joe Orton wrote:
> On Sat, Aug 20, 2005 at 12:29:56PM +0100, Nick Kew wrote:
>>When writing APR applications, we sometimes need to make heavy
>>use of APR #ifdefs.
>>A case in point is mod_dbd, which uses either apr_reslist or a
>>single persistent connection according to whether APR_HAS_THREADS.
>>As an APR application, this would be greatly simplified if
>>apr_reslist fell back to a trivial implementation of a single
>>resource in the non-threaded case, sparing the application
>>the burden of dealing with it.
> I think it would be far far better to make APR ABI-compatible not just 

Hmmm, fair point.

> and define 
> ENOTIMPL stubs for everything in the !THREADS case.

I think that needs to be APR_SUCCESS stubs for a null operation.
That's what apps test against, and there's no error condition!

Anyway, having *public API* functions *conditionally* defined in the
APR headers is a booby trap for apps, and should be killed off.

Nick Kew

View raw message