]> git.ipfire.org Git - thirdparty/git.git/commitdiff
unify and bump _WIN32_WINNT definition to Windows 8.1
authorMatthias Aßhauer <mha1993@live.de>
Mon, 6 Apr 2026 05:45:29 +0000 (05:45 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Apr 2026 17:06:20 +0000 (10:06 -0700)
Git for Windows doesn't support anything prior to Windows 8.1 since 2.47.0
and Git followed along with commits like ce6ccba (mingw: drop Windows
7-specific work-around, 2025-08-04).

There is no need to pretend to the compiler that we still support Windows
Vista, just to lock us out of easy access to newer APIs. There is also no
need to have conflicting and unused definitions claiming we support some
versions of Windows XP or even Windows NT 4.0.

Bump all definitions of _WIN32_WINNT to a realistic value of Windows 8.1.
This will also simplify code for a followup commit that will improve cpu
core detection on multi-socket systems.

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c
compat/nedmalloc/malloc.c.h
compat/poll/poll.c
compat/posix.h
compat/win32/flush.c

index 338ec3535edf41c6ba7e5fa3f06be1a20e6e824a..2023c16db6574258dd6403f7fde29f86e314c34b 100644 (file)
@@ -2464,7 +2464,7 @@ repeat:
        if (supports_file_rename_info_ex) {
                /*
                 * Our minimum required Windows version is still set to Windows
-                * Vista. We thus have to declare required infrastructure for
+                * 8.1. We thus have to declare required infrastructure for
                 * FileRenameInfoEx ourselves until we bump _WIN32_WINNT to
                 * 0x0A00. Furthermore, we have to handle cases where the
                 * FileRenameInfoEx call isn't supported yet.
index 814845d4b33fc89652be9fe0c1cd0d55e59023a3..e0c567586c878c61565203858665a009b589f47d 100644 (file)
@@ -500,7 +500,7 @@ MAX_RELEASE_CHECK_RATE   default: 4095 unless not HAVE_MMAP
 #ifdef WIN32
 #define WIN32_LEAN_AND_MEAN
 #ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x403
+#define _WIN32_WINNT 0x603
 #endif
 #include <windows.h>
 #define HAVE_MMAP 1
index a2becd16cd0bd019aae9a4dba9ff5bf10cd5b1c6..ea362b4a8e2340b1e92287162f13840dd04c39c3 100644 (file)
@@ -20,7 +20,7 @@
 
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
-/* To bump the minimum Windows version to Windows Vista */
+/* To bump the minimum Windows version to Windows 8.1 */
 #include "git-compat-util.h"
 
 /* Tell gcc not to warn about the (nfd < 0) tests, below.  */
@@ -41,7 +41,7 @@
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 # define WIN32_NATIVE
 # if defined (_MSC_VER) && !defined(_WIN32_WINNT)
-#  define _WIN32_WINNT 0x0502
+#  define _WIN32_WINNT 0x0603
 # endif
 # include <winsock2.h>
 # include <windows.h>
index 3c611d2736c47af930d169e67f611771f03376d8..94699a03fa5d6923e4380e3f95b234a69bc8e7de 100644 (file)
@@ -76,7 +76,7 @@
 
 #if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
 # if !defined(_WIN32_WINNT)
-#  define _WIN32_WINNT 0x0600
+#  define _WIN32_WINNT 0x0603
 # endif
 #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */
 #include <winsock2.h>
index 291f90ea9406ba655456d0d5f50b05adb3a96404..7244ff69ac08b7d9c184cd77c6ac14c13de29fca 100644 (file)
@@ -6,7 +6,9 @@ int win32_fsync_no_flush(int fd)
 {
        IO_STATUS_BLOCK io_status;
 
+#ifndef FLUSH_FLAGS_FILE_DATA_ONLY
 #define FLUSH_FLAGS_FILE_DATA_ONLY 1
+#endif
 
        DECLARE_PROC_ADDR(ntdll.dll, NTSTATUS, NTAPI, NtFlushBuffersFileEx,
                         HANDLE FileHandle, ULONG Flags, PVOID Parameters, ULONG ParameterSize,