apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@apache.org>
Subject Re: Does APR_HAVE_LIMITS_H do anything on Dev Studio builds?
Date Thu, 28 Mar 2013 04:00:56 GMT
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


Mime
View raw message