summaryrefslogtreecommitdiff
path: root/m4/netdb_h.m4
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-04-28 16:46:16 -0600
committerEric Blake <eblake@redhat.com>2011-04-28 17:35:16 -0600
commit74175b903b1716c1677658e45fa69ef1fbc99015 (patch)
treeea876262a1dc6e99eacad03069070d6f7a064b93 /m4/netdb_h.m4
parent7aa5e8dd3a8431c2354197961b3f2cd76864091f (diff)
downloadgnulib-74175b903b1716c1677658e45fa69ef1fbc99015.tar.gz
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>
Diffstat (limited to 'm4/netdb_h.m4')
-rw-r--r--m4/netdb_h.m41
1 files changed, 1 insertions, 0 deletions
diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4
index 9a01cd6a76..259c7a3181 100644
--- a/m4/netdb_h.m4
+++ b/m4/netdb_h.m4
@@ -37,4 +37,5 @@ AC_DEFUN([gl_NETDB_H_DEFAULTS],
HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR])
HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO])
HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO])
+ REPLACE_GAI_STRERROR=0; AC_SUBST([REPLACE_GAI_STRERROR])
])