httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <>
Subject Re: cvs commit: apache-2.0/src/lib/apr/threadproc/unix thread.c
Date Sat, 11 Dec 1999 20:15:00 GMT
> > 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.

This comes down to APR and Apache being two different packages that happen
to be being written by the same group.  They are no more related than
Apache and PHP are related in my mind, except that Apache is going to rely
on APR for it's OS specific code.  Much in the same way that Apache relies
on PHP for a scripting language.  The decisions I am making are the
correct decisions as I see them for APR.  I am the person who gets
questions when APR doesn't compile on a given platform, and I am trying to
make my life and the life of any future APR person easier.  I will not
change what is right for APR because it makes Apache's life easier.

In answer to your question, your solution doesn't address the problem.
When I look at apr.h, I can see one of two things.



#define APR_HAS_THREADS @threads@

Now, the shell variable threads can expand to either 1/0 or "#define
APR_HAS_THREADS 1"/"#under APR_HAS_THREADS".  As somebody who has to deal
with porting APR to other platforms, the second option makes it VERY
obvious what we are trying to define here.  Think of this as a windows
programmer, who doesn't have autoconf, @threads@ could be just about
anything, but the second option makes it MUCH clearer what we are trying
to get across.

> 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!"

The fact remains, this is the correct decision for APR.  I really believe
that as we continue to use autoconf/automake in Apache, we are going to
find out that always using #ifdef is the wrong answer, because there are
going to be times that we actually do want to assign a 0/1/2/3 value to a

If you want to change so that all macros are using the same syntax,
re-visit the question in the Apache space.  I personally don't care what
Apache uses, for all I care, in one of the Apache header files, we could


In fact, I did something like that just Friday.  It gives the Apache
programmer a common syntax while still allowing APR to make the correct
decision for that project.

Until I see a reason other than "This isn't what we decided for Apache", I
don't consider this an open question.


Ryan Bloom
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	

View raw message