httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: apache-2.0/src/lib/apr/threadproc/unix thread.c
Date Sat, 11 Dec 1999 12:31:30 GMT
On Tue, 7 Dec 1999 rbb@apache.org wrote:
> On Mon, 6 Dec 1999, Greg Stein wrote:
> > >   Cleanup some mistakes I made.  We are now configuring the APR_HAS_FOO
> > >   macros in a cleaner way IMO, and that required that we always use #if
> > >   instead of #ifdef.  I also used the wrong #if HAVE_SIGNAL_H macro
> > >   in apr_pools.c.
> > 
> > This seems very wrong, to me. We just got done having a discussion that we
> > would be using the #ifdef variety for feature testing. I do not think we
> > ought to be using #ifdef for autoconf tests, but #if for APR tests. We are
> > sure to run into a confusion somewhere and have unexpected results.
> > 
> > Why can't we use #ifdef for APR, too?
> 
> Because of the separation that autoconf requires.  This code is MUCH
> cleaner for the configuration.  I can define shell variables to be 0/1 or
> I can define them to be "#define APR_HAS_THREADS 1"/"#under
> APR_HAS_THREADS", and then substitute those shell variables into a header
> file.  The first case is easier to understand when you look at the
> pre-generated header file.  I personally believe Apache will end up
> heading this way as well, because it will need to do the same basic steps
> as I have already done to get the separation required.

You could also define shell variables as 0/1 and a utility macro/function
spits out the correct form.

Really: using two forms feels *very* wrong and subject to biting us in the
ass down the road. "oh! that was a #if form rather than #ifdef! damn!"

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message