Hash :
74175b90
Author :
Date :
2011-04-28T16:46:16
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>
@node gai_strerror
@section @code{gai_strerror}
@findex gai_strerror
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/gai_strerror.html}
Gnulib module: getaddrinfo
Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
HP-UX 11.11, IRIX 6.5, OSF/1 4.0, Solaris 7, Cygwin 1.5.x, Interix
3.5, BeOS.
@item
This function is only available in @code{<ws2tcpip.h>} on some
platforms:
mingw.
@item
This function's return type is @code{char *} instead of @code{const char *}
on some platforms:
AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 9, mingw.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@end itemize