On Wed, 12 Jun 2002, Miguel Camargo wrote:

> I am trying to modify the APR library just to add some specific features
> in it and use it in Apache.

What kinds of things, just out of curiosity?

> But i have some doubts about the meaning and the differences among the
> macro definitions of:

The first thing to note is that all of these are always defined -- you
check whether their value is 0 or 1 -- as opposed to the HAVE_FOO macros
that autoconf provides, which are either defined or undefined.  That means
the test you should use on all of them is #if and not #ifdef.

> APR_HAVE_...

These are ones that come straight out of what autoconf provides us, except
we've namespace-protected them (and done the 0/1 instead of undef/def
thing I mentioned above).  So basically this means the system provides
some item (typically a header file, a given function, a structure, etc);
so APR_HAVE_STDIO_H tells you whether or not stdio.h exists.
APR_HAVE_MEMMOVE tells you whether or not the memmove() function is
provided by the system, etc.

> APR_USE_...

These are used where multiple choices are provided by the OS; they tell
APR which one to use by default.  For example, there might be multiple
methods of getting a shared memory segment; one of the APR_USE_SHMEM_*
macros will be 1 to tell APR which one to prefer.

> APR_HAS_...

These are "feature" macros; they tell us that APR has support for some
broad feature available (where "broad feature" doesn't map to a single
function call or header but rather a whole group of them).  For example,
APR_HAS_MMAP tells us whether APR's MMAP support is available.
APR_HAS_THREADS tells us whether APR was built in multi-threaded mode.
And so on.


There are a *few* cases where we use HAVE where we should be using HAS,
and those ought to be cleaned up.  But we're mostly consistent.  :)

Hope this helps.

--Cliff


Reply via email to