kopia lustrzana https://github.com/Hamlib/Hamlib
Properly detect getaddrinfo() under newer mingw-w64
rodzic
8b41f25aa8
commit
fb43df0ba6
|
@ -122,10 +122,10 @@ void freeaddrinfo(struct addrinfo *res)
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_GETADDRINFO */
|
#endif /* !HAVE_GETADDRINFO */
|
||||||
|
|
||||||
#if !defined(HAVE_GAI_STRERROR) && !defined(gai_strerror)
|
#if !defined(HAVE_DECL_GAI_STRERROR) && !defined(gai_strerror)
|
||||||
const char *gai_strerror(int errcode)
|
const char *gai_strerror(int errcode)
|
||||||
{
|
{
|
||||||
return strerror(errcode);
|
return strerror(errcode);
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_GAI_STRERROR */
|
#endif /* !HAVE_DECL_GAI_STRERROR */
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,37 @@ AC_CHECK_TYPES([struct addrinfo],[],[],[
|
||||||
#endif
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([getaddrinfo gai_strerror])
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
|
#include <sys/types.h>
|
||||||
|
#if HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#elif HAVE_WS2TCPIP_H
|
||||||
|
# include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
|
#include <stddef.h>
|
||||||
|
]],
|
||||||
|
[[getaddrinfo("", "", NULL, NULL);]])],
|
||||||
|
[ac_cv_func_getaddrinfo=yes
|
||||||
|
AC_DEFINE(HAVE_GETADDRINFO,[1],[Define if getaddrinfo is available])],
|
||||||
|
[ac_cv_func_getaddrinfo=no])
|
||||||
|
|
||||||
|
|
||||||
|
AC_CHECK_DECLS([gai_strerror], [], [], [[
|
||||||
|
#include <sys/types.h>
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_WS2TCPIP_H
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
|
#include <stddef.h>
|
||||||
|
]])
|
||||||
|
|
||||||
dnl Checks for replacements
|
dnl Checks for replacements
|
||||||
AC_REPLACE_FUNCS([getaddrinfo])
|
AC_REPLACE_FUNCS([getaddrinfo])
|
||||||
|
@ -96,9 +126,9 @@ int getaddrinfo(const char *node, const char *service,
|
||||||
void freeaddrinfo(struct addrinfo *res);
|
void freeaddrinfo(struct addrinfo *res);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_GAI_STRERROR) && !defined(gai_strerror)
|
#if !defined(HAVE_DECL_GAI_STRERROR) && !defined(gai_strerror)
|
||||||
const char *gai_strerror(int errcode);
|
const char *gai_strerror(int errcode);
|
||||||
#endif /* !HAVE_GAI_STRERROR */
|
#endif /* !HAVE_DECL_GAI_STRERROR */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue