httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: cvs commit: apache-2.0/src/modules/standard mod_auth_digest.c
Date Fri, 02 Jun 2000 01:24:47 GMT
> Date: Thu, 1 Jun 2000 18:04:22 -0700
> From: Manoj Kasichainula <manoj@io.com>
> 
> On Thu, Jun 01, 2000 at 08:41:53PM -0400, Jeff Trawick wrote:
> > . it is a bug in the app if it doesn't use the feature test macro 
> 
> Not really. If my module requires shared memory, why bother filling up
> my code with macros that test for it? Just fail to compile.

#include "apr.h"
#if !APR_HAS_WIDGET || !APR_HAS_DOODAD || !APR_HAS_THINGAMABOBBER
#error You stupid shit!  Read the doc!
#endif

Is this module full of tests? 

> 
> > The APR_ENOTIMPL flavor of the function enables some possible
> > simplification for app writers that play by the rules.  (Consider that
> > you gotta check those return codes anyway; you can't just call
> > ap_xlate_open() and ignore the return code anywhere.)
> 
> Yeah, but you have to add an extra check for ENOTIMPL. Error checking
> code is intrusive enough as it is.

rv = ap_create_widget(...);
if (rv) {
    fprintf(stderr, "ap_create_widget() failed: %s\n",
            ap_strerror(rv, buf, sizeof buf));
}

Granted, that may not be useful for all apps, but it is o.k. for some
and there is no check for APR_ENOTIMPL.

Some apps are just going to need to check for APR_HAS_WIDGET, and it
is helpful whether or not we have the APR_ENOTIMPL flavor.  For apps
where some obscure option fails due to !APR_HAS_WIDGET, normal error
handling can catch.


-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message