X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fgetaddrinfo.m4;h=1d631f8cb8464d8e84cde5aa066cb3feb5cec915;hb=69770559f5bf198928150ac8162734d7f6b99c82;hp=20a62261189acfceec4651ed8a8d762cf6f3c071;hpb=8ca509d08317df62371980106295d87d950ec989;p=gnulib.git diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4 index 20a622611..1d631f8cb 100644 --- a/m4/getaddrinfo.m4 +++ b/m4/getaddrinfo.m4 @@ -1,5 +1,5 @@ -# getaddrinfo.m4 serial 26 -dnl Copyright (C) 2004-2011 Free Software Foundation, Inc. +# getaddrinfo.m4 serial 30 +dnl Copyright (C) 2004-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -63,7 +63,7 @@ AC_DEFUN([gl_GETADDRINFO], # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an # inline function declared in ws2tcpip.h, so we need to get that # header included somehow. - AC_CHECK_DECLS([gai_strerror, gai_strerrorA], [], [break], [[ + AC_CHECK_DECLS([gai_strerror], [], [], [[ #include #ifdef HAVE_SYS_SOCKET_H #include @@ -77,6 +77,19 @@ AC_DEFUN([gl_GETADDRINFO], #include ]]) if test $ac_cv_have_decl_gai_strerror = yes; then + AC_CHECK_DECLS([gai_strerrorA], [], [], [[ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +#include +]]) dnl check for correct signature AC_CACHE_CHECK([for gai_strerror with POSIX signature], [gl_cv_func_gai_strerror_posix_signature], [ @@ -92,7 +105,11 @@ AC_DEFUN([gl_GETADDRINFO], #include #endif #include -extern const char *gai_strerror(int);]])], +extern +#ifdef __cplusplus +"C" +#endif +const char *gai_strerror(int);]])], [gl_cv_func_gai_strerror_posix_signature=yes], [gl_cv_func_gai_strerror_posix_signature=no])]) if test $gl_cv_func_gai_strerror_posix_signature = no; then @@ -117,7 +134,6 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_SOCKET_FAMILIES]) AC_REQUIRE([gl_HEADER_SYS_SOCKET]) - AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl Including sys/socket.h is wrong for Windows, but Windows does not @@ -129,7 +145,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ AC_CHECK_HEADERS_ONCE([netinet/in.h]) - AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, getnameinfo],,,[ + AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, getnameinfo],,,[[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -143,7 +159,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ #ifdef HAVE_WS2TCPIP_H #include #endif -]) +]]) if test $ac_cv_have_decl_getaddrinfo = no; then HAVE_DECL_GETADDRINFO=0 fi