This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit a2d7066253d656afe9f87e742b8b386eb445993f Author: Kacper Michajłow <[email protected]> AuthorDate: Sat Aug 22 17:14:15 2026 +0200 Commit: Kacper Michajłow <[email protected]> CommitDate: Mon Sep 7 03:57:59 2026 +0000 configure: drop support for MSVC runtimes older than UCRT The C11 requirement makes the effective MSVC floor VS2019 16.8, which ships only the UCRT. Pre-UCRT CRTs (_VC_CRT_MAJOR_VERSION < 14) cannot appear in a supported build, and the UCRT provides C99-correct snprintf, strtod, strtoll and strtoull. Signed-off-by: Kacper Michajłow <[email protected]> --- compat/msvcrt/snprintf.c | 71 ------------------------------------------------ compat/msvcrt/snprintf.h | 38 -------------------------- configure | 14 ---------- 3 files changed, 123 deletions(-) diff --git a/compat/msvcrt/snprintf.c b/compat/msvcrt/snprintf.c deleted file mode 100644 index 43f5c3bb39..0000000000 --- a/compat/msvcrt/snprintf.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * C99-compatible snprintf() and vsnprintf() implementations - * Copyright (c) 2012 Ronald S. Bultje <[email protected]> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <stdio.h> -#include <stdarg.h> -#include <limits.h> -#include <string.h> - -#include "compat/va_copy.h" -#include "libavutil/error.h" - -#if defined(__MINGW32__) -#define EOVERFLOW EFBIG -#endif - -int avpriv_snprintf(char *s, size_t n, const char *fmt, ...) -{ - va_list ap; - int ret; - - va_start(ap, fmt); - ret = avpriv_vsnprintf(s, n, fmt, ap); - va_end(ap); - - return ret; -} - -int avpriv_vsnprintf(char *s, size_t n, const char *fmt, - va_list ap) -{ - int ret; - va_list ap_copy; - - if (n == 0) - return _vscprintf(fmt, ap); - else if (n > INT_MAX) - return AVERROR(EOVERFLOW); - - /* we use n - 1 here because if the buffer is not big enough, the MS - * runtime libraries don't add a terminating zero at the end. MSDN - * recommends to provide _snprintf/_vsnprintf() a buffer size that - * is one less than the actual buffer, and zero it before calling - * _snprintf/_vsnprintf() to workaround this problem. - * See https://web.archive.org/web/20151214111935/http://msdn.microsoft.com/en-us/library/1kt27hek(v=vs.80).aspx */ - memset(s, 0, n); - va_copy(ap_copy, ap); - ret = _vsnprintf(s, n - 1, fmt, ap_copy); - va_end(ap_copy); - if (ret == -1) - ret = _vscprintf(fmt, ap); - - return ret; -} diff --git a/compat/msvcrt/snprintf.h b/compat/msvcrt/snprintf.h deleted file mode 100644 index cd47953e87..0000000000 --- a/compat/msvcrt/snprintf.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * C99-compatible snprintf() and vsnprintf() implementations - * Copyright (c) 2012 Ronald S. Bultje <[email protected]> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef COMPAT_MSVCRT_SNPRINTF_H -#define COMPAT_MSVCRT_SNPRINTF_H - -#include <stdarg.h> -#include <stdio.h> - -int avpriv_snprintf(char *s, size_t n, const char *fmt, ...); -int avpriv_vsnprintf(char *s, size_t n, const char *fmt, va_list ap); - -#undef snprintf -#undef _snprintf -#undef vsnprintf -#define snprintf avpriv_snprintf -#define _snprintf avpriv_snprintf -#define vsnprintf avpriv_vsnprintf - -#endif /* COMPAT_MSVCRT_SNPRINTF_H */ diff --git a/configure b/configure index 16af8bc695..2a1207cf96 100755 --- a/configure +++ b/configure @@ -6484,23 +6484,9 @@ probe_libc(){ add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then eval ${pfx}libc_type=msvcrt - if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then - if [ "$pfx" = host_ ]; then - add_host_cppflags -Dsnprintf=_snprintf - else - add_compat strtod.o strtod=avpriv_strtod - add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \ - _snprintf=avpriv_snprintf \ - vsnprintf=avpriv_vsnprintf - fi - fi add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0601" && add_${pfx}cppflags -D_WIN32_WINNT=0x0601 - if [ "$pfx" = "" ]; then - check_func strtoll || add_allcflags -Dstrtoll=_strtoi64 - check_func strtoull || add_allcflags -Dstrtoull=_strtoui64 - fi elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then eval ${pfx}libc_type=klibc elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
