getaddrinfo: fix gai_strerror signature
Several platforms declare gai_strerror to return char* rather than
const char*. Worse, on mingw, if UNICODE is defined, it is defined
to return WCHAR*, which means the result is in unicode but an
application expecting bytes for characters will only see a one-byte
answer.
* m4/getaddrinfo.m4 (gl_GETADDRINFO): Detect broken signatures,
and work around mingw with UNICODE defined.
(gl_PREREQ_GETADDRINFO): Drop redundant decl check.
* m4/netdb_h.m4 (gl_NETDB_H_DEFAULTS): Add witness.
* modules/netdb (Makefile.am): Substitute it.
* lib/netdb.in.h (gai_strerror): Declare replacement.
* lib/gai_strerror.c (rpl_gai_strerror): Fix signature.
* doc/posix-functions/gai_strerror.texi (gai_strerror): Document
the fix.
Signed-off-by: Eric Blake <eblake@redhat.com>