Re: Small patch: fix warnings during compilation on FreeBSD - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Small patch: fix warnings during compilation on FreeBSD
Date
Msg-id CA+TgmoZP90nJ0-kO9g114M+F7QgrWGx3GxWo+X+2zqOQz-244w@mail.gmail.com
Whole thread Raw
In response to Re: Small patch: fix warnings during compilation on FreeBSD  (Aleksander Alekseev <a.alekseev@postgrespro.ru>)
Responses Re: Small patch: fix warnings during compilation on FreeBSD
List pgsql-hackers
On Fri, Mar 11, 2016 at 9:13 AM, Aleksander Alekseev
<a.alekseev@postgrespro.ru> wrote:
> Hello, Tom
>
>> I think what we need is configure logic to find out where wcstombs_l()
>> is declared, and then #include <xlocale.h> only if it's necessary to
>> get that definition.  I haven't experimented but probably you could
>> make such a check with nested uses of AC_CHECK_DECL.
>
> Sounds like quite a dirty hack to me. Besides so far we have only two
> procedures from xlocale.h and this requires two checks. If we go this
> way someday there will be 15 checks for every procedure from xlocale.h

Eh, probably not.  Most likely, if you check whether one of the
functions you care about is in that file, that's good enough.  Either
all of them will be there or none of them.  That may sound
unprincipled, but I think in practice it works pretty well, and I
think it's basically the autoconf way.  You make the checks just
sophisticated enough to work on all of the platforms that actually
exist, and don't worry about hypothetical platforms where the header
file authors conspire to hose you.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: PostgreSQL 9.6 Release Management Team (RMT)
Next
From: Tom Lane
Date:
Subject: Re: Small patch: fix warnings during compilation on FreeBSD