apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: When to use HAVE_XXX_H or APR_HAVE_XXX_H
Date Thu, 17 Sep 2009 18:23:56 GMT
Rainer Jung wrote:
> When compiling mod_ftp 0.9.5 I ran into the problem, that is was using
> APR_HAVE_SYS_STAT_H instead of HAVE_SYS_STAT_H.
> 
> I saw in configure.in, that apr tests for a lot of headers, but it
> doesn't set an APR_HAVE_* define for all of them in apr.h.in.

That is correct.  For compatibility, we can introduce any that we believe
are useful into apr 2.0, but not apr 1.3.  The rule of thumb, IIRC, was that
headers *we need* to include within our public headers must be "exported"
with APR_HAVE_ symbols.  Those which we consume internally are just that,
internal only.

Of course, folks applied different thumbs, so I don't know that this was
done consistently.

> In the case of sys/stat.h this leads to the situation, that code uses
> APR_HAVE_SYS_STAT_H although it seems it is never defined. Even some
> files in apr itself use this define. Other files in apr use HAVE_SYS_STAT_H.
> 
> Is there some policy, when to use APR_HAVE_* defines for testing the
> includes and when to use the HAVE_* type defines?

The immediate solution for your problem was to yank the faulty APR_HAVE test
that never existed, and add an application test.

Long term, we aught to decide if what's described above was policy;
if so, perhaps we should document it?  If not, perhaps we should add
APR_HAVE_SYS_STAT_H for apr 2.0 (even for 1.4)?

Bill

Mime
View raw message