aboutsummaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-11-27 17:57:46 +0000
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-11-28 12:32:51 +0000
commitef8125e3aea8a7a364ffd1c154809a10f2f399f5 (patch)
tree9b684e559f96cafce8938d1f1819ed2db1d51441 /ConfigureChecks.cmake
parentede0bc5d61a0aadb426f1be605f493d58a68f990 (diff)
Move two functions from epan to wsutil/str_util
Move epan_memmem() and epan_strcasestr() to wsutil/str_util. Rename to ws_memmem() and ws_strcasestr(). Add compile time check for a system implementation and use that if available. We invoke those functions using a wrapper to avoid exposing _GNU_SOURCE outside of the implementation.
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 786f35c0de..b60c6dc39d 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -92,6 +92,13 @@ if (APPLE)
check_function_exists("CFPropertyListCreateWithStream" HAVE_CFPROPERTYLISTCREATEWITHSTREAM)
cmake_pop_check_state()
endif()
+if(UNIX)
+ cmake_push_check_state()
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+ check_function_exists("memmem" HAVE_MEMMEM)
+ check_function_exists("strcasestr" HAVE_STRCASESTR)
+ cmake_pop_check_state()
+endif()
#Struct members
include(CheckStructHasMember)