]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
configure/cmake: remove checks for unused inet_ntoa and inet_ntoa_r
authorGergely Nagy <ngg@tresorit.com>
Fri, 18 Jun 2021 08:16:16 +0000 (10:16 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 18 Jun 2021 11:52:18 +0000 (13:52 +0200)
Closes #7276

CMake/CurlTests.c
CMake/Platforms/WindowsCache.cmake
CMakeLists.txt
configure.ac
lib/inet_ntop.c
m4/curl-functions.m4
m4/curl-reentrant.m4

index 2fcce1bb3833f3570bb2209ead25f06aa8900e36..9c278ec50e762d7b3146e626a0f32cb64a4973b4 100644 (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>
index 8f92cbd79eb548fce55f861a0b95ae2c57285fe7..2f96dbca330ca919afd859173c43ebc12ed01667 100644 (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()
index 6ad3e0ada9d51b01d8cbe86d6141c460c6714424..0fb196a13007d237b0f5cd0e52f53426efe1da65 100644 (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)
 
index b13d83d08ebca3156fda46204141fc3e9850c0e1..de957855215b8914aab4c878954088db68fc07a3 100644 (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
index 4c3e9e4dadd1c03416fbe388874fd949e40e9c17..b5f9b808afd0592340c54e1db892768f67ffcccf 100644 (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:
index 1a21ca0be4740f973439731c96b1fe1dd352fa49..ffade127d72355acf75f90e1d7dd36ad1dbdb144 100644 (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
index 4655b054751b39702e5cc67494791bbef7e6cd5b..3e4d6a96908d359bbecaa2df5e1a16a86d22b24e 100644 (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