httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <man...@io.com>
Subject Re: cvs commit: apache-2.0/src/modules/standard mod_include.c mod_log_config.c mod_negotiation.c
Date Sat, 22 Jan 2000 00:44:49 GMT
(Text rearranged, and extra context provided, since I took so long to
respond to this)

On Tue, Dec 21, 1999 at 05:54:10PM -0500, Ryan Bloom wrote:
> Option 1)
> 
> In apr.h.in:
> 
> @THREADS@
> 
> In configure.in: (In psuedo-code)
> 
> if {check for threading support}
>     THREADS="#define APR_HAS_THREADS
> else
>     THREADS="#undef APR_HAS_THREADS
> fi
> 
> AC_SUBST(THREADS)
>
> I initially opted for the first method, because it stuck with the #if rule
> that Apache had adopted.  I happened to have made this change a few days
> before leaving work for a few days for personal reasons.  While I was
> gone, I had three different people contact me to find out what those
> @THREADS@ things were there for.  One of these people was trying to get
> autoconf working on his system again, the other two were trying to port
> APR to a platform without autoconf.

This probably would've been much clearer to people if the macro had
been DEFINE_IF_THREADS_ENABLED, with a comment mentioning what each
of these were. Then, I would think people wouldn't be confused.

Or:

Option 3)

(what PHP does for some vars it wants to expose)

configure.in:

PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
echo "/* edit configure.in.in to change version number */" >> php_version.h.new
echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new

etc.

> Option 2)
> 
> In apr.h:
> 
> #define APR_HAS_THREADS @THREADS@
> 
> In configure.in
> 
> if {check for threading support}
>     THREADS="1"
> else
>     THREADS="0"
> fi
> 
> AC_SUBST(THREADS)
> 
> Option 2 is much clearer in this respect.  It is obvious what we are
> trying to figure out.  Plus, #if is much more powerful that #ifdef.  There
> are times that we don't want to check if something is defined, but we want
> to check what the value of a definition is.  Case in point, What version
> of AIX are we on?

Some autoconf macros' content are inspected. See the results of
AC_FUNC_SELECT_ARGTYPES, for example.

> If we are going to come right out and limit
> ourselves to either #if or #ifdef, them we had better choose wisely,
> because this issue will bite us when we want the added functionality of
> #if, but we can't use it because Apache 2.0 only uses #ifdef.

The autoheader convention is to #undef feature macros. And AFAIK, the
overwhelming possibility is that all ANSI compilers will support #if
if the feature macros are undefed.

So, I think that we should #undef feature macros, and we will have the
ability to convert #ifs to #ifdefs or back whenever we want.


Mime
View raw message