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

From Aleksander Alekseev
Subject Re: Small patch: fix warnings during compilation on FreeBSD
Date
Msg-id 20160311171317.58ad623d@fujitsu
Whole thread Raw
In response to Re: Small patch: fix warnings during compilation on FreeBSD  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Small patch: fix warnings during compilation on FreeBSD
List pgsql-hackers
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
and logic like:

```
#if PROC1_DEFINED_IN_XLOCALE || PROC2_DEFINED_IN_XLOCALE ...
#include <xlocale.h>
#endif
```

Perhaps we could just use __FreeBSD__ macro instead (see attachments)?
Or maybe create our own macro ALWAYS_INCLUDE_XLOCALE in configure
script which currently will depend only on used OS? Naturally this
definition could be changed in the future.

Best regards,
Aleksander


Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: auto_explain sample rate
Next
From: Julien Rouhaud
Date:
Subject: Re: auto_explain sample rate