]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: fix the snprintf detection
authorYurii Rashkovskii <yrashk@gmail.com>
Sat, 24 Dec 2022 01:45:30 +0000 (17:45 -0800)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 26 Dec 2022 08:32:37 +0000 (09:32 +0100)
I haven't had the time to check other configurations, but on my macOS
Ventura 13.1 with XCode 14.2 cmake does not find `snprintf`.

Solution: ensure stdio.h is checked for definitions

Closes #10155

CMakeLists.txt

index b4352075144f43022908f3db9348e506848e5720..2bed81eaeec4432cf180e96f7f55ff54072347d7 100644 (file)
@@ -1092,7 +1092,7 @@ check_symbol_exists(setrlimit      "${CURL_INCLUDES}" HAVE_SETRLIMIT)
 
 if(NOT MSVC OR (MSVC_VERSION GREATER_EQUAL 1900))
   # earlier MSVC compilers had faulty snprintf implementations
-  check_symbol_exists(snprintf       "${CURL_INCLUDES}" HAVE_SNPRINTF)
+  check_symbol_exists(snprintf       "stdio.h" HAVE_SNPRINTF)
 endif()
 check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME)
 check_symbol_exists(inet_ntop      "${CURL_INCLUDES}" HAVE_INET_NTOP)