[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 31/282: CMake: use check_symbol_exists also for inet_pton
From: |
gnunet |
Subject: |
[gnurl] 31/282: CMake: use check_symbol_exists also for inet_pton |
Date: |
Wed, 01 Apr 2020 14:28:16 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit be578eea7e4d97a3c74fc7e1341ee258925e08ff
Author: Marcel Raad <address@hidden>
AuthorDate: Sat Jan 11 11:20:38 2020 +0100
CMake: use check_symbol_exists also for inet_pton
It doesn't make much sense to only check if the function can be linked
when it's not declared in any header and that is treated as an error.
With the correct target Windows version set, the function is declared
in ws2tcpip.h and the comment above the modified block is invalid.
Also, move the definition of `_WIN32_WINNT` up to before all symbol
availability checks so that we don't have to care which ones must be
done after it.
Tested with Visual Studio 2019 and current MinGW-w64.
Closes https://github.com/curl/curl/pull/4808
---
CMakeLists.txt | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8be8a332..649db52a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -858,6 +858,16 @@ elseif(HAVE_LIBSOCKET)
set(CMAKE_REQUIRED_LIBRARIES socket)
endif()
+if(WIN32)
+ if(ENABLE_INET_PTON)
+ # _WIN32_WINNT_VISTA (0x0600)
+ add_definitions(-D_WIN32_WINNT=0x0600)
+ else()
+ # _WIN32_WINNT_WINXP (0x0501)
+ add_definitions(-D_WIN32_WINNT=0x0501)
+ endif()
+endif()
+
check_symbol_exists(basename "${CURL_INCLUDES}" HAVE_BASENAME)
check_symbol_exists(socket "${CURL_INCLUDES}" HAVE_SOCKET)
check_symbol_exists(select "${CURL_INCLUDES}" HAVE_SELECT)
@@ -929,20 +939,7 @@ check_symbol_exists(fcntl "${CURL_INCLUDES}"
HAVE_FCNTL)
check_symbol_exists(ioctl "${CURL_INCLUDES}" HAVE_IOCTL)
check_symbol_exists(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT)
check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME)
-
-# symbol exists in win32, but function does not.
-if(WIN32)
- if(ENABLE_INET_PTON)
- check_function_exists(inet_pton HAVE_INET_PTON)
- # _WIN32_WINNT_VISTA (0x0600)
- add_definitions(-D_WIN32_WINNT=0x0600)
- else()
- # _WIN32_WINNT_WINXP (0x0501)
- add_definitions(-D_WIN32_WINNT=0x0501)
- endif()
-else()
- check_function_exists(inet_pton HAVE_INET_PTON)
-endif()
+check_symbol_exists(inet_pton "${CURL_INCLUDES}" HAVE_INET_PTON)
check_symbol_exists(fsetxattr "${CURL_INCLUDES}" HAVE_FSETXATTR)
if(HAVE_FSETXATTR)
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 09/282: include: remove non-curl prefixed defines, (continued)
- [gnurl] 09/282: include: remove non-curl prefixed defines, gnunet, 2020/04/01
- [gnurl] 21/282: libssh2: add support for forcing a hostkey type, gnunet, 2020/04/01
- [gnurl] 22/282: misc: Copyright year out of date, should be 2020, gnunet, 2020/04/01
- [gnurl] 19/282: schannel: Make CURLOPT_CAINFO work better on Windows 7, gnunet, 2020/04/01
- [gnurl] 23/282: curl: remove 'config' field from OutStruct, gnunet, 2020/04/01
- [gnurl] 13/282: hostip: move code to resolve IP address literals to `Curl_resolv`, gnunet, 2020/04/01
- [gnurl] 11/282: test1167: verify global symbols in public headers are curl prefixed, gnunet, 2020/04/01
- [gnurl] 25/282: curl: make #0 not output the full URL, gnunet, 2020/04/01
- [gnurl] 26/282: ConnectionExists: respect the max_concurrent_streams limits, gnunet, 2020/04/01
- [gnurl] 30/282: schannel_verify: Fix alt names manual verify for UNICODE builds, gnunet, 2020/04/01
- [gnurl] 31/282: CMake: use check_symbol_exists also for inet_pton,
gnunet <=
- [gnurl] 39/282: ROADMAP: thread-safe `curl_global_init()`, gnunet, 2020/04/01
- [gnurl] 27/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 33/282: wolfssh: set the password correctly for PASSWORD auth, gnunet, 2020/04/01
- [gnurl] 42/282: CMake: support specifying the target Windows version, gnunet, 2020/04/01
- [gnurl] 35/282: libssh2: fix variable type, gnunet, 2020/04/01
- [gnurl] 24/282: wolfSSH: new SSH backend, gnunet, 2020/04/01
- [gnurl] 45/282: http: move "oauth_bearer" from connectdata to Curl_easy, gnunet, 2020/04/01
- [gnurl] 40/282: HTTP: increase EXPECT_100_THRESHOLD to 1Mb, gnunet, 2020/04/01
- [gnurl] 32/282: wolfssh: remove fprintf() calls (and uses of __func__), gnunet, 2020/04/01
- [gnurl] 46/282: copyright: fix year ranges, gnunet, 2020/04/01