]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: add feature checks for `memrchr` and `getifaddrs`
authorViktor Szakats <commit@vsz.me>
Mon, 25 Sep 2023 22:35:26 +0000 (22:35 +0000)
committerViktor Szakats <commit@vsz.me>
Tue, 26 Sep 2023 22:10:28 +0000 (22:10 +0000)
- `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

CMake/Platforms/WindowsCache.cmake
CMakeLists.txt
lib/curl_config.h.cmake

index a8e66e2fbecd7d740b9071fb2d6afc67aadb9e62..edf60588552efad111c13a0ee0a19fc8271220fa 100644 (file)
@@ -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)
index e57446ebbf5013429c65eef190007ce4e094c0c0..6161b7db7a2423ba8a118d6e964fe5e8fc60e8b4 100644 (file)
@@ -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()
index 7aefe428dd5f61643b0f7bfa026afee5146b2a02..4e6b4437ec54b7d8edfb53edd556f43ddf11b648 100644 (file)
 /* 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