1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-12 20:45:03 -05:00

configure/cmake: remove checks for unused inet_ntoa and inet_ntoa_r

Closes #7276
This commit is contained in:
Gergely Nagy 2021-06-18 10:16:16 +02:00 committed by Daniel Stenberg
parent e92603289a
commit f471efa78c
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
7 changed files with 2 additions and 212 deletions

View File

@ -214,37 +214,6 @@ if (sizeof (bool *) )
#include <float.h>
int main() { return 0; }
#endif
#ifdef HAVE_INET_NTOA_R_DECL
#include <arpa/inet.h>
typedef void (*func_type)();
int main()
{
#ifndef inet_ntoa_r
func_type func;
func = (func_type)inet_ntoa_r;
(void)func;
#endif
return 0;
}
#endif
#ifdef HAVE_INET_NTOA_R_DECL_REENTRANT
#define _REENTRANT
#include <arpa/inet.h>
typedef void (*func_type)();
int main()
{
#ifndef inet_ntoa_r
func_type func;
func = (func_type)&inet_ntoa_r;
(void)func;
#endif
return 0;
}
#endif
#ifdef HAVE_GETADDRINFO
#include <netdb.h>
#include <sys/types.h>

View File

@ -86,8 +86,6 @@ if(NOT UNIX)
set(HAVE_GETHOSTBYADDR 1)
set(HAVE_GETTIMEOFDAY 0)
set(HAVE_INET_ADDR 1)
set(HAVE_INET_NTOA 1)
set(HAVE_INET_NTOA_R 0)
set(HAVE_CLOSESOCKET 1)
set(HAVE_SETVBUF 0)
set(HAVE_SIGSETJMP 0)
@ -122,8 +120,6 @@ if(NOT UNIX)
set(TIME_WITH_SYS_TIME 0)
set(HAVE_O_NONBLOCK 0)
set(HAVE_IN_ADDR_T 0)
set(HAVE_INET_NTOA_R_DECL 0)
set(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
if(ENABLE_IPV6)
set(HAVE_GETADDRINFO 1)
else()

View File

@ -1019,8 +1019,6 @@ check_symbol_exists(gethostbyaddr "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR)
check_symbol_exists(gethostbyaddr_r "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR_R)
check_symbol_exists(gettimeofday "${CURL_INCLUDES}" HAVE_GETTIMEOFDAY)
check_symbol_exists(inet_addr "${CURL_INCLUDES}" HAVE_INET_ADDR)
check_symbol_exists(inet_ntoa "${CURL_INCLUDES}" HAVE_INET_NTOA)
check_symbol_exists(inet_ntoa_r "${CURL_INCLUDES}" HAVE_INET_NTOA_R)
check_symbol_exists(closesocket "${CURL_INCLUDES}" HAVE_CLOSESOCKET)
check_symbol_exists(sigsetjmp "${CURL_INCLUDES}" HAVE_SIGSETJMP)
check_symbol_exists(getpass_r "${CURL_INCLUDES}" HAVE_GETPASS_R)
@ -1128,8 +1126,6 @@ foreach(CURL_TEST
HAVE_IN_ADDR_T
HAVE_BOOL_T
STDC_HEADERS
HAVE_INET_NTOA_R_DECL
HAVE_INET_NTOA_R_DECL_REENTRANT
HAVE_GETADDRINFO
HAVE_FILE_OFFSET_BITS
HAVE_VARIADIC_MACROS_C99
@ -1166,8 +1162,7 @@ foreach(CURL_TEST
HAVE_GETHOSTBYADDR_R_8
HAVE_GETHOSTBYNAME_R_3
HAVE_GETHOSTBYNAME_R_5
HAVE_GETHOSTBYNAME_R_6
HAVE_INET_NTOA_R_DECL_REENTRANT)
HAVE_GETHOSTBYNAME_R_6)
if(NOT ${CURL_TEST})
if(${CURL_TEST}_REENTRANT)
set(NEED_REENTRANT 1)
@ -1190,11 +1185,6 @@ if(NEED_REENTRANT)
endforeach()
endif()
if(HAVE_INET_NTOA_R_DECL_REENTRANT)
set(HAVE_INET_NTOA_R_DECL 1)
set(NEED_REENTRANT 1)
endif()
# Check clock_gettime(CLOCK_MONOTONIC, x) support
curl_internal_test(HAVE_CLOCK_GETTIME_MONOTONIC)

View File

@ -3232,7 +3232,6 @@ CURL_CHECK_FUNC_GETSOCKNAME
CURL_CHECK_FUNC_IF_NAMETOINDEX
CURL_CHECK_FUNC_GETIFADDRS
CURL_CHECK_FUNC_GMTIME_R
CURL_CHECK_FUNC_INET_NTOA_R
CURL_CHECK_FUNC_INET_NTOP
CURL_CHECK_FUNC_INET_PTON
CURL_CHECK_FUNC_IOCTL

View File

@ -40,7 +40,7 @@
#define INT16SZ 2
/*
* Format an IPv4 address, more or less like inet_ntoa().
* Format an IPv4 address, more or less like inet_ntop().
*
* Returns `dst' (as a const)
* Note:

View File

@ -3388,130 +3388,6 @@ AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [
])
dnl CURL_CHECK_FUNC_INET_NTOA_R
dnl -------------------------------------------------
dnl Verify if inet_ntoa_r is available, prototyped,
dnl and can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_inet_ntoa_r, then
dnl HAVE_INET_NTOA_R will be defined.
AC_DEFUN([CURL_CHECK_FUNC_INET_NTOA_R], [
AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
#
tst_links_inet_ntoa_r="unknown"
tst_proto_inet_ntoa_r="unknown"
tst_compi_inet_ntoa_r="unknown"
tst_allow_inet_ntoa_r="unknown"
tst_nargs_inet_ntoa_r="unknown"
#
AC_MSG_CHECKING([if inet_ntoa_r can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([inet_ntoa_r])
],[
AC_MSG_RESULT([yes])
tst_links_inet_ntoa_r="yes"
],[
AC_MSG_RESULT([no])
tst_links_inet_ntoa_r="no"
])
#
if test "$tst_links_inet_ntoa_r" = "yes"; then
AC_MSG_CHECKING([if inet_ntoa_r is prototyped])
AC_EGREP_CPP([inet_ntoa_r],[
$curl_includes_arpa_inet
],[
AC_MSG_RESULT([yes])
tst_proto_inet_ntoa_r="yes"
],[
AC_MSG_RESULT([no])
tst_proto_inet_ntoa_r="no"
])
fi
#
if test "$tst_proto_inet_ntoa_r" = "yes"; then
if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
AC_MSG_CHECKING([if inet_ntoa_r takes 2 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_arpa_inet
]],[[
struct in_addr addr;
if(0 != inet_ntoa_r(addr, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_inet_ntoa_r="yes"
tst_nargs_inet_ntoa_r="2"
],[
AC_MSG_RESULT([no])
tst_compi_inet_ntoa_r="no"
])
fi
if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
AC_MSG_CHECKING([if inet_ntoa_r takes 3 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_arpa_inet
]],[[
struct in_addr addr;
if(0 != inet_ntoa_r(addr, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_inet_ntoa_r="yes"
tst_nargs_inet_ntoa_r="3"
],[
AC_MSG_RESULT([no])
tst_compi_inet_ntoa_r="no"
])
fi
AC_MSG_CHECKING([if inet_ntoa_r is compilable])
if test "$tst_compi_inet_ntoa_r" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
#
if test "$tst_compi_inet_ntoa_r" = "yes"; then
AC_MSG_CHECKING([if inet_ntoa_r usage allowed])
if test "x$curl_disallow_inet_ntoa_r" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_inet_ntoa_r="yes"
else
AC_MSG_RESULT([no])
tst_allow_inet_ntoa_r="no"
fi
fi
#
AC_MSG_CHECKING([if inet_ntoa_r might be used])
if test "$tst_links_inet_ntoa_r" = "yes" &&
test "$tst_proto_inet_ntoa_r" = "yes" &&
test "$tst_compi_inet_ntoa_r" = "yes" &&
test "$tst_allow_inet_ntoa_r" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_INET_NTOA_R, 1,
[Define to 1 if you have the inet_ntoa_r function.])
dnl AC_DEFINE_UNQUOTED(INET_NTOA_R_ARGS, $tst_nargs_inet_ntoa_r,
dnl [Specifies the number of arguments to inet_ntoa_r])
#
if test "$tst_nargs_inet_ntoa_r" -eq "2"; then
AC_DEFINE(HAVE_INET_NTOA_R_2, 1, [inet_ntoa_r() takes 2 args])
elif test "$tst_nargs_inet_ntoa_r" -eq "3"; then
AC_DEFINE(HAVE_INET_NTOA_R_3, 1, [inet_ntoa_r() takes 3 args])
fi
#
curl_cv_func_inet_ntoa_r="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_inet_ntoa_r="no"
fi
])
dnl CURL_CHECK_FUNC_INET_NTOP
dnl -------------------------------------------------
dnl Verify if inet_ntop is available, prototyped, can

View File

@ -214,43 +214,6 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRTOK_R], [
])
dnl CURL_CHECK_NEED_REENTRANT_INET_NTOA_R
dnl -------------------------------------------------
dnl Checks if the preprocessor _REENTRANT definition
dnl makes function inet_ntoa_r compiler visible.
AC_DEFUN([CURL_CHECK_NEED_REENTRANT_INET_NTOA_R], [
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([inet_ntoa_r])
],[
tmp_inet_ntoa_r="yes"
],[
tmp_inet_ntoa_r="no"
])
if test "$tmp_inet_ntoa_r" = "yes"; then
AC_EGREP_CPP([inet_ntoa_r],[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
],[
tmp_inet_ntoa_r="proto_declared"
],[
AC_EGREP_CPP([inet_ntoa_r],[
#define _REENTRANT
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
],[
tmp_inet_ntoa_r="proto_needs_reentrant"
tmp_need_reentrant="yes"
])
])
fi
])
dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R
dnl -------------------------------------------------
dnl Checks if the preprocessor _REENTRANT definition
@ -369,9 +332,6 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R], [
if test "$tmp_need_reentrant" = "no"; then
CURL_CHECK_NEED_REENTRANT_STRTOK_R
fi
if test "$tmp_need_reentrant" = "no"; then
CURL_CHECK_NEED_REENTRANT_INET_NTOA_R
fi
if test "$tmp_need_reentrant" = "no"; then
CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R
fi