[PR] configure: make _WIN32_WINNT == 0x0601 the minimum supported version (PR #24025)

James Almer via ffmpeg-devel <[email protected]> Wed, 05 Aug 2026 22:30:11 -0000
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <178596901184.59.612666244646667822@29965ddac10e>
PR #24025 opened by James Almer (jamrial)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24025
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24025.patch

Every hardware accel implementation and now Vulkan require API present stating with Windows 7, so it's about time we stop pretending to support Vista.

See !24018


>From a1983222f1bb4b5e4f956d7165ad62c9d0cbdf11 Mon Sep 17 00:00:00 2001
From: James Almer <[email protected]>
Date: Wed, 5 Aug 2026 19:27:28 -0300
Subject: [PATCH] configure: make _WIN32_WINNT == 0x0601 the minimum supported
 version

Every hardware accel implementation and now Vulkan require API present
stating with Windows 7, so it's about time we stop pretending to support
Vista.

Signed-off-by: James Almer <[email protected]>
---
 configure | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/configure b/configure
index 8ac272a155..f2896b81c7 100755
--- a/configure
+++ b/configure
@@ -6428,8 +6428,8 @@ probe_libc(){
         if ! test_${pfx}cpp_condition crtdefs.h "defined(_UCRT)"; then
             add_${pfx}cppflags -D__USE_MINGW_ANSI_STDIO=1
         fi
-        test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
-            add_${pfx}cppflags -D_WIN32_WINNT=0x0600
+        test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0601" &&
+            add_${pfx}cppflags -D_WIN32_WINNT=0x0601
         add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
     elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION"  ||
          test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
@@ -6443,8 +6443,8 @@ probe_libc(){
         fi
         test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
             add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
-        test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
-            add_${pfx}cppflags -D_WIN32_WINNT=0x0600
+        test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0601" &&
+            add_${pfx}cppflags -D_WIN32_WINNT=0x0601
         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
@@ -6459,18 +6459,8 @@ probe_libc(){
             fi
         fi
         add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
-        # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
-        # 0x601 by default unless something else is set by the user.
-        # This can easily lead to us detecting functions only present
-        # in such new versions and producing binaries requiring windows 7.0.
-        # Therefore explicitly set the default to Vista unless the user has
-        # set something else on the command line.
-        # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
-        # family. For these cases, configure is free to use any functions
-        # found in the SDK headers by default. (Alternatively, we could force
-        # _WIN32_WINNT to 0x0602 in that case.)
-        test_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
-            { test_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0600; }
+        test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0601" &&
+            add_${pfx}cppflags -D_WIN32_WINNT=0x0601
 #ifdef WINAPI_FAMILY
 #include <winapifamily.h>
 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
@@ -7040,7 +7030,7 @@ check_headers direct.h
 check_headers dirent.h
 check_headers dxgidebug.h
 check_headers dxva.h
-check_headers dxva2api.h -D_WIN32_WINNT=0x0600
+check_headers dxva2api.h
 check_headers io.h
 enabled libdrm &&
     check_headers linux/dma-buf.h
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]