You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Joe Swatosh <jo...@gmail.com> on 2013/03/27 06:12:48 UTC
Does APR_HAVE_LIMITS_H do anything on Dev Studio builds?
Hi All,
I've downloaded a few versions of APR and looked into apr.hw on each
of them and I see APR_HAVE_LIMITS_H being set, but I don't see the
equivalent of block like:
/* header files for PATH_MAX, _POSIX_PATH_MAX */
#if APR_HAVE_LIMITS_H
#include <limits.h>
#else
#if APR_HAVE_SYS_SYSLIMITS_H
#include <sys/syslimits.h>
#endif
#endif
which I find in apr.h.in.
I must be missing something. How is this supposed to work?
Thanks!
--
Joe
Re: Does APR_HAVE_LIMITS_H do anything on Dev Studio builds?
Posted by Branko Čibej <br...@apache.org>.
On 28.03.2013 02:42, Joe Swatosh wrote:
> <<--snip-->>
>
>> I think what this means is that apr.h on Unix needed something from
>> that file (presumably *_PATH_MAX) in order to work, but it wasn't
>> needed on Windows.
>>
>> So you're left with a side effect (including that .h file) on Unix
>> that doesn't exist on Windows. Either way you have APR_HAVE_foo_H
>> exported in case you need to use it.
>>
> I think you've nailed it. When I suggested #include'ing <limits.h> my
> Unix using friends immediately asked "isn't that included by apr.h?" I
> think we've been relying on the side effect. And in fact I just
> reviewed my original thread with them and they've since decided that
> we should add the <limits.h> include after all.
Indeed, I've always found it to be good practice to include /all/
headers explicitly referenced by a .c file, regardless of how many times
they actually end up being included. That's why it's also a good idea to
make headers idempotent, and to make sure they only contain
declarations, not definitions.
-- Brane
Re: Does APR_HAVE_LIMITS_H do anything on Dev Studio builds?
Posted by Joe Swatosh <jo...@gmail.com>.
<<--snip-->>
>
> I think what this means is that apr.h on Unix needed something from
> that file (presumably *_PATH_MAX) in order to work, but it wasn't
> needed on Windows.
>
> So you're left with a side effect (including that .h file) on Unix
> that doesn't exist on Windows. Either way you have APR_HAVE_foo_H
> exported in case you need to use it.
>
I think you've nailed it. When I suggested #include'ing <limits.h> my
Unix using friends immediately asked "isn't that included by apr.h?" I
think we've been relying on the side effect. And in fact I just
reviewed my original thread with them and they've since decided that
we should add the <limits.h> include after all.
Thanks a million!
--
Joe
<<--snip-->>
Re: Does APR_HAVE_LIMITS_H do anything on Dev Studio builds?
Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Mar 27, 2013 at 1:12 AM, Joe Swatosh <jo...@gmail.com> wrote:
> Hi All,
>
> I've downloaded a few versions of APR and looked into apr.hw on each
> of them and I see APR_HAVE_LIMITS_H being set, but I don't see the
> equivalent of block like:
>
> /* header files for PATH_MAX, _POSIX_PATH_MAX */
> #if APR_HAVE_LIMITS_H
> #include <limits.h>
> #else
> #if APR_HAVE_SYS_SYSLIMITS_H
> #include <sys/syslimits.h>
> #endif
> #endif
>
> which I find in apr.h.in.
>
> I must be missing something. How is this supposed to work?
I think what this means is that apr.h on Unix needed something from
that file (presumably *_PATH_MAX) in order to work, but it wasn't
needed on Windows.
So you're left with a side effect (including that .h file) on Unix
that doesn't exist on Windows. Either way you have APR_HAVE_foo_H
exported in case you need to use it.
Was your APR app missing something from limits.h when compiled on
Windows, or did you encounter some other sort of problem because of
this?
>
> Thanks!
> --
> Joe
--
Born in Roswell... married an alien...
http://emptyhammock.com/