httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: code cleanup
Date Mon, 21 Jul 1997 16:48:14 GMT
This changes functions from doing x if y is enabled and having undefined
behavior otherwise to doing x if y is enabled, otherwise doing nothing.

It means that anywhere you need to do x, you simply do x() in the code; if
whatever uses x() isn't enabled in that server, it simply does nothing. 
This takes what ap_select does one step further.  I think I like the idea,
but if taken too far it can be more confusion than it is worth. 

On Mon, 21 Jul 1997 rasmus@bellglobal.com wrote:

> >      There is a lot of occurrences of the code in the form
> > #if defined(STUFF) 
> >      some_func()
> > #endif
> >      which is really "not good" especially if some_func() is 
> > invoked multiple times.  One of the possible solutions is to change 
> > the above to following:
> > 
> > #if defined (STUFF)
> > some_func() 
> > {
> >      ...
> > }
> > #else
> > #define some_func() /* nop */
> > #endif
> 
> But #if defined() is a preprocessor directive.  I don't understand the
> motivation for this one.
> 
> -Rasmus
> 


Mime
View raw message