← Commit list

d557c06b52

Viktor Szakats
Viktor Szakats
2026-03-02
SUCCESS Duration: 312s

Subject

build: drop unused `snprintf()` feature check on Windows

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

CMake/win32-cache.cmake+0 -6
@@ -33,7 +33,6 @@ if(MINGW)
set(HAVE_GETTIMEOFDAY 1)
set(HAVE_LIBGEN_H 1)
set(HAVE_OPENDIR 1)
- set(HAVE_SNPRINTF 1)
set(HAVE_STDBOOL_H 1)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
@@ -60,11 +59,6 @@ else()
set(HAVE_STDBOOL_H 0)
endif()
set(HAVE_BOOL_T "${HAVE_STDBOOL_H}")
- if(MSVC_VERSION GREATER_EQUAL 1900)
- set(HAVE_SNPRINTF 1)
- else()
- set(HAVE_SNPRINTF 0)
- endif()
set(HAVE_BASENAME 0)
endif()
endif()
CMakeLists.txt+1 -5
@@ -1633,6 +1633,7 @@ if(NOT WIN32)
check_function_exists("if_nametoindex" HAVE_IF_NAMETOINDEX) # net/if.h
check_function_exists("realpath" HAVE_REALPATH)
check_function_exists("sched_yield" HAVE_SCHED_YIELD)
+ check_function_exists("snprintf" HAVE_SNPRINTF) # to match detection method in ./configure
check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP)
check_symbol_exists("stricmp" "string.h" HAVE_STRICMP)
check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI)
@@ -1646,11 +1647,6 @@ if(NOT _ssl_enabled)
check_symbol_exists("arc4random" "${CURL_INCLUDES};stdlib.h" HAVE_ARC4RANDOM)
endif()
-if(NOT MSVC)
- check_function_exists("snprintf" HAVE_SNPRINTF) # to match detection method in ./configure
-elseif(MSVC_VERSION GREATER_EQUAL 1900) # Earlier MSVC compilers had faulty snprintf implementations
- check_symbol_exists("snprintf" "stdio.h" HAVE_SNPRINTF) # snprintf may be a compatibility macro, not an exported function
-endif()
if(APPLE)
check_function_exists("mach_absolute_time" HAVE_MACH_ABSOLUTE_TIME)
endif()
configure.ac+1 -1
@@ -4190,7 +4190,6 @@ AC_CHECK_FUNCS([\
sendmsg \
setlocale \
setrlimit \
- snprintf \
utime \
utimes \
])
@@ -4200,6 +4199,7 @@ if test "$curl_cv_native_windows" != "yes"; then
if_nametoindex \
realpath \
sched_yield \
+ snprintf \
])
CURL_CHECK_FUNC_INET_NTOP
CURL_CHECK_FUNC_INET_PTON
lib/config-win32.h+0 -5
@@ -159,11 +159,6 @@
/* Define to the function return type for send. */
#define SEND_TYPE_RETV int
-/* Define to 1 if you have the snprintf function. */
-#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || defined(__MINGW32__)
-#define HAVE_SNPRINTF 1
-#endif
-
/* Must always use local implementations on Windows. */
/* Define to 1 if you have an IPv6 capable working inet_ntop function. */
/* #undef HAVE_INET_NTOP */