]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: delete duplicate HAVE_GETADDRINFO test
authorViktor Szakats <commit@vsz.me>
Fri, 14 Oct 2022 17:31:19 +0000 (17:31 +0000)
committerViktor Szakats <commit@vsz.me>
Fri, 14 Oct 2022 17:31:19 +0000 (17:31 +0000)
A custom `HAVE_GETADDRINFO` check came with the initial CMake commit
[1]. A later commit [2] added a standard check for it as well. The
standard check run before the custom one, so CMake ignored the latter.

The custom check was also non-portable, so this patch deletes it in
favor of the standard check.

[1] 4c5307b45655ba75ab066564afdc0c111a8b9291
[2] aec7c5a87c8482b6ddffa352d7d220698652262e

Closes #9731

CMake/CurlTests.c
CMakeLists.txt

index 0ea7a541f068b4b4bad9f3840ca9372fc66a5c5d..6a9fdea0989c1f9d2220a70d97b95db417c92b55 100644 (file)
@@ -184,28 +184,6 @@ if (sizeof (bool *) )
 #include <float.h>
 int main() { return 0; }
 #endif
-#ifdef HAVE_GETADDRINFO
-#include <netdb.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-int main(void) {
-    struct addrinfo hints, *ai;
-    int error;
-
-    memset(&hints, 0, sizeof(hints));
-    hints.ai_family = AF_UNSPEC;
-    hints.ai_socktype = SOCK_STREAM;
-#ifndef getaddrinfo
-    (void)getaddrinfo;
-#endif
-    error = getaddrinfo("127.0.0.1", "8080", &hints, &ai);
-    if (error) {
-        return 1;
-    }
-    return 0;
-}
-#endif
 #ifdef HAVE_FILE_OFFSET_BITS
 #ifdef _FILE_OFFSET_BITS
 #undef _FILE_OFFSET_BITS
index 156fe790392dcb85d633aa151def7b46fb779f36..70ef457cf4df3da2c683dac6a68ef9c18c914aaa 100644 (file)
@@ -1130,7 +1130,6 @@ foreach(CURL_TEST
     HAVE_IN_ADDR_T
     HAVE_BOOL_T
     STDC_HEADERS
-    HAVE_GETADDRINFO
     HAVE_FILE_OFFSET_BITS
     HAVE_VARIADIC_MACROS_C99
     HAVE_VARIADIC_MACROS_GCC