You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Manoj Kasichainula <ma...@raleigh.ibm.com> on 1999/11/30 00:06:27 UTC

APR leaking HAVE_* macros

A number of APR header files are #including apr_config.h and leaking
the HAVE_* macros from autoconf. They are clashing with the HAVE_
macros that will be present in Apache once the autoconf scripts are
committed.

Why is this #include necessary? I would think that APR's include files
should have no dependancies on the particular machine, and those
macros pollute the namespace of the application.

In fact, why are any of the system includes (i.e. sys/types.h)
necessary in the user-visible include files? I would think they should
confined to APR-internal .c or .h files.

Other than the warnings from this, compiles using autoconf or
src/Configure are working fine for me.

-- 
Manoj Kasichainula - manojk@raleigh.ibm.com
IBM, Apache Development

Re: APR leaking HAVE_* macros

Posted by Rasmus Lerdorf <ra...@raleigh.ibm.com>.
> Nope.  There are times and places where we do need system specific header
> files inside APR's public headers.  We should always be protecting those
> with #if HAVE_FOO_H.  
> 
> I have another questions, why are you trying to determine the same things
> that APR has already figured out for you?  APR can already tell you if the
> current system has a particular header file, and Apache shouldn't need too
> many platform specific headers anymore anyway.
> 
> I think having APR and Apache both doing the same tests is a bit
> ridiculus.  If Apache needs to know about what the system has, that
> information can be found in APR.

Nothing in Apache should be including apr_config.h and nothing in APR
should be including Apache's config.h.  When you have two separate
autoconf trees, they need to be kept separate.  If they are not to be kept
separate, they should not be two separate autoconf trees.  It is as simple
as that.  If you really want one to include the other's config.h file,
then we need to remove the autoconf stuff from APR and have the top-level
autoconf script handle it and only do a config.m4 for APR.

-Rasmus


Re: APR leaking HAVE_* macros

Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
I spoke too soon last night.

> Why is this #include necessary? I would think that APR's include files
> should have no dependancies on the particular machine, and those
> macros pollute the namespace of the application.

Those include directives are necessary, because they tell APR about the
machine we are on.  I can't define ap_int*_t unless I know how big each
integer type is on the current machine.  Those need to be defined
somewhere, and that definition needs to be available to ALL of APR.  The
same thing can be said for the other times we are including apr_config.h.

> In fact, why are any of the system includes (i.e. sys/types.h)
> necessary in the user-visible include files? I would think they should
> confined to APR-internal .c or .h files.

Nope.  There are times and places where we do need system specific header
files inside APR's public headers.  We should always be protecting those
with #if HAVE_FOO_H.  

I have another questions, why are you trying to determine the same things
that APR has already figured out for you?  APR can already tell you if the
current system has a particular header file, and Apache shouldn't need too
many platform specific headers anymore anyway.

I think having APR and Apache both doing the same tests is a bit
ridiculus.  If Apache needs to know about what the system has, that
information can be found in APR.

I will try to remove as much "leaking" as I can, but I can almost 
garauntee that there will always be some leaking from APR.

Ryan

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
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.	



Re: APR leaking HAVE_* macros

Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
I'll fix this over the next few days.  A lot of this is left over from
original development of APR.  Some of it was just poor planning.  I'll
investigate tomorrow when I get a chance, and start committing as soon as
I can figure out how to avoid the problem.  There should be very few files
includeing non-APR headers.

Ryan

On Mon, 29 Nov 1999, Manoj Kasichainula wrote:

> A number of APR header files are #including apr_config.h and leaking
> the HAVE_* macros from autoconf. They are clashing with the HAVE_
> macros that will be present in Apache once the autoconf scripts are
> committed.
> 
> Why is this #include necessary? I would think that APR's include files
> should have no dependancies on the particular machine, and those
> macros pollute the namespace of the application.
> 
> In fact, why are any of the system includes (i.e. sys/types.h)
> necessary in the user-visible include files? I would think they should
> confined to APR-internal .c or .h files.
> 
> Other than the warnings from this, compiles using autoconf or
> src/Configure are working fine for me.
> 
> -- 
> Manoj Kasichainula - manojk@raleigh.ibm.com
> IBM, Apache Development
> 

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
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.