From: Viktor Szakats Date: Mon, 25 Sep 2023 22:35:26 +0000 (+0000) Subject: cmake: add feature checks for `memrchr` and `getifaddrs` X-Git-Tag: curl-8_4_0~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1411c5eb33794e16e3fa63df7d2bf17c639851ef;p=thirdparty%2Fcurl.git cmake: add feature checks for `memrchr` and `getifaddrs` - `HAVE_MEMRCHR` for `memrchr`. - `HAVE_GETIFADDRS` for `getifaddrs`. This was present in `lib/curl_config.h.cmake` but missed the detection logic. To match existing autotools feature checks. Closes #11954 --- diff --git a/CMake/Platforms/WindowsCache.cmake b/CMake/Platforms/WindowsCache.cmake index a8e66e2fbe..edf6058855 100644 --- a/CMake/Platforms/WindowsCache.cmake +++ b/CMake/Platforms/WindowsCache.cmake @@ -88,6 +88,7 @@ if(NOT UNIX) set(HAVE_STRDUP 1) set(HAVE_STRICMP 1) set(HAVE_STRCMPI 1) + set(HAVE_MEMRCHR 0) set(HAVE_GETTIMEOFDAY 0) set(HAVE_CLOSESOCKET 1) set(HAVE_SIGSETJMP 0) @@ -102,6 +103,7 @@ if(NOT UNIX) set(HAVE_LINUX_TCP_H 0) set(HAVE_GLIBC_STRERROR_R 0) set(HAVE_MACH_ABSOLUTE_TIME 0) + set(HAVE_GETIFADDRS 0) set(HAVE_GETHOSTBYNAME_R_3 0) set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0) diff --git a/CMakeLists.txt b/CMakeLists.txt index e57446ebbf..6161b7db7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1088,6 +1088,7 @@ check_symbol_exists(strtok_r "${CURL_INCLUDES};string.h" HAVE_STRTOK_R) check_symbol_exists(strcasecmp "${CURL_INCLUDES};string.h" HAVE_STRCASECMP) check_symbol_exists(stricmp "${CURL_INCLUDES};string.h" HAVE_STRICMP) check_symbol_exists(strcmpi "${CURL_INCLUDES};string.h" HAVE_STRCMPI) +check_symbol_exists(memrchr "${CURL_INCLUDES};string.h" HAVE_MEMRCHR) check_symbol_exists(alarm "${CURL_INCLUDES}" HAVE_ALARM) check_symbol_exists(getppid "${CURL_INCLUDES}" HAVE_GETPPID) check_symbol_exists(utimes "${CURL_INCLUDES}" HAVE_UTIMES) @@ -1109,6 +1110,7 @@ check_symbol_exists(strtoll "${CURL_INCLUDES};stdlib.h" HAVE_STRTOLL) check_symbol_exists(strerror_r "${CURL_INCLUDES};stdlib.h;string.h" HAVE_STRERROR_R) check_symbol_exists(siginterrupt "${CURL_INCLUDES}" HAVE_SIGINTERRUPT) check_symbol_exists(getaddrinfo "${CURL_INCLUDES};stdlib.h;string.h" HAVE_GETADDRINFO) +check_symbol_exists(getifaddrs "${CURL_INCLUDES};stdlib.h" HAVE_GETIFADDRS) if(WIN32) set(HAVE_GETADDRINFO_THREADSAFE ${HAVE_GETADDRINFO}) endif() diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index 7aefe428dd..4e6b4437ec 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -502,6 +502,9 @@ /* Define to 1 if you have the strtoll function. */ #cmakedefine HAVE_STRTOLL 1 +/* Define to 1 if you have the memrchr function. */ +#cmakedefine HAVE_MEMRCHR 1 + /* if struct sockaddr_storage is defined */ #cmakedefine HAVE_STRUCT_SOCKADDR_STORAGE 1