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
This commit is contained in:
Viktor Szakats 2023-09-25 22:35:26 +00:00
parent 3795fcde99
commit 1411c5eb33
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
3 changed files with 7 additions and 0 deletions

View 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)

View 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()

View File

@ -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