* [PATCH] unify and bump _WIN32_WINNT definition to Windows 8.1
@ 2026-04-05 10:54 Johannes Schindelin via GitGitGadget
2026-04-06 5:45 ` [PATCH v2 0/2] " Johannes Schindelin via GitGitGadget
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2026-04-05 10:54 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin, Matthias Aßhauer
From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>
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>
---
unify and bump _WIN32_WINNT definition to Windows 8.1
A clean-up while preparing for v2.54.0.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2081%2Fdscho%2Fdrop-windows-vista-support-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2081/dscho/drop-windows-vista-support-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2081
compat/mingw.c | 2 +-
compat/nedmalloc/malloc.c.h | 2 +-
compat/poll/poll.c | 4 ++--
compat/posix.h | 2 +-
compat/win32/flush.c | 2 ++
5 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index 338ec3535e..2023c16db6 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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.
diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h
index 814845d4b3..e0c567586c 100644
--- a/compat/nedmalloc/malloc.c.h
+++ b/compat/nedmalloc/malloc.c.h
@@ -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
diff --git a/compat/poll/poll.c b/compat/poll/poll.c
index a2becd16cd..ea362b4a8e 100644
--- a/compat/poll/poll.c
+++ b/compat/poll/poll.c
@@ -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>
diff --git a/compat/posix.h b/compat/posix.h
index 3c611d2736..94699a03fa 100644
--- a/compat/posix.h
+++ b/compat/posix.h
@@ -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>
diff --git a/compat/win32/flush.c b/compat/win32/flush.c
index 291f90ea94..7244ff69ac 100644
--- a/compat/win32/flush.c
+++ b/compat/win32/flush.c
@@ -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,
base-commit: 2855562ca6a9c6b0e7bc780b050c1e83c9fcfbd0
--
gitgitgadget
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 0/2] unify and bump _WIN32_WINNT definition to Windows 8.1
2026-04-05 10:54 [PATCH] unify and bump _WIN32_WINNT definition to Windows 8.1 Johannes Schindelin via GitGitGadget
@ 2026-04-06 5:45 ` Johannes Schindelin via GitGitGadget
2026-04-06 5:45 ` [PATCH v2 1/2] " Matthias Aßhauer via GitGitGadget
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2026-04-06 5:45 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin
Clean-up while preparing for v2.54.0.
Changes since v1:
* Added a patch I had forgotten to include.
Matthias Aßhauer (2):
unify and bump _WIN32_WINNT definition to Windows 8.1
compat/winansi: drop pre-Vista workaround
compat/mingw.c | 2 +-
compat/nedmalloc/malloc.c.h | 2 +-
compat/poll/poll.c | 4 ++--
compat/posix.h | 2 +-
compat/win32/flush.c | 2 ++
compat/winansi.c | 37 ++++---------------------------------
6 files changed, 11 insertions(+), 38 deletions(-)
base-commit: 2855562ca6a9c6b0e7bc780b050c1e83c9fcfbd0
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2081%2Fdscho%2Fdrop-windows-vista-support-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2081/dscho/drop-windows-vista-support-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/2081
Range-diff vs v1:
1: 949696de7a = 1: 949696de7a unify and bump _WIN32_WINNT definition to Windows 8.1
-: ---------- > 2: 0b50c30cdd compat/winansi: drop pre-Vista workaround
--
gitgitgadget
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] unify and bump _WIN32_WINNT definition to Windows 8.1
2026-04-06 5:45 ` [PATCH v2 0/2] " Johannes Schindelin via GitGitGadget
@ 2026-04-06 5:45 ` Matthias Aßhauer via GitGitGadget
2026-04-06 5:45 ` [PATCH v2 2/2] compat/winansi: drop pre-Vista workaround Matthias Aßhauer via GitGitGadget
2026-04-06 17:07 ` [PATCH v2 0/2] unify and bump _WIN32_WINNT definition to Windows 8.1 Junio C Hamano
2 siblings, 0 replies; 5+ messages in thread
From: Matthias Aßhauer via GitGitGadget @ 2026-04-06 5:45 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin, Matthias Aßhauer
From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>
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>
---
compat/mingw.c | 2 +-
compat/nedmalloc/malloc.c.h | 2 +-
compat/poll/poll.c | 4 ++--
compat/posix.h | 2 +-
compat/win32/flush.c | 2 ++
5 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index 338ec3535e..2023c16db6 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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.
diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h
index 814845d4b3..e0c567586c 100644
--- a/compat/nedmalloc/malloc.c.h
+++ b/compat/nedmalloc/malloc.c.h
@@ -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
diff --git a/compat/poll/poll.c b/compat/poll/poll.c
index a2becd16cd..ea362b4a8e 100644
--- a/compat/poll/poll.c
+++ b/compat/poll/poll.c
@@ -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>
diff --git a/compat/posix.h b/compat/posix.h
index 3c611d2736..94699a03fa 100644
--- a/compat/posix.h
+++ b/compat/posix.h
@@ -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>
diff --git a/compat/win32/flush.c b/compat/win32/flush.c
index 291f90ea94..7244ff69ac 100644
--- a/compat/win32/flush.c
+++ b/compat/win32/flush.c
@@ -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,
--
gitgitgadget
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] compat/winansi: drop pre-Vista workaround
2026-04-06 5:45 ` [PATCH v2 0/2] " Johannes Schindelin via GitGitGadget
2026-04-06 5:45 ` [PATCH v2 1/2] " Matthias Aßhauer via GitGitGadget
@ 2026-04-06 5:45 ` Matthias Aßhauer via GitGitGadget
2026-04-06 17:07 ` [PATCH v2 0/2] unify and bump _WIN32_WINNT definition to Windows 8.1 Junio C Hamano
2 siblings, 0 replies; 5+ messages in thread
From: Matthias Aßhauer via GitGitGadget @ 2026-04-06 5:45 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin, Matthias Aßhauer
From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>
1edeb9a (Win32: warn if the console font doesn't support Unicode,
2014-06-10) introduced both code to detect the current console font on
Windows Vista and newer and a fallback for older systems to detect the
default console font and issue a warning if that font doesn't support
unicode.
Since we haven't supported any Windows older than Vista in almost a
decade, we don't need to keep the workaround.
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
compat/winansi.c | 37 ++++---------------------------------
1 file changed, 4 insertions(+), 33 deletions(-)
diff --git a/compat/winansi.c b/compat/winansi.c
index ac2ffb7869..3ce1900939 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -32,47 +32,18 @@ static int non_ascii_used = 0;
static HANDLE hthread, hread, hwrite;
static HANDLE hconsole1, hconsole2;
-#ifdef __MINGW32__
-#if !defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 5
-typedef struct _CONSOLE_FONT_INFOEX {
- ULONG cbSize;
- DWORD nFont;
- COORD dwFontSize;
- UINT FontFamily;
- UINT FontWeight;
- WCHAR FaceName[LF_FACESIZE];
-} CONSOLE_FONT_INFOEX, *PCONSOLE_FONT_INFOEX;
-#endif
-#endif
-
static void warn_if_raster_font(void)
{
DWORD fontFamily = 0;
- DECLARE_PROC_ADDR(kernel32.dll, BOOL, WINAPI,
- GetCurrentConsoleFontEx, HANDLE, BOOL,
- PCONSOLE_FONT_INFOEX);
+ CONSOLE_FONT_INFOEX cfi;
/* don't bother if output was ascii only */
if (!non_ascii_used)
return;
- /* GetCurrentConsoleFontEx is available since Vista */
- if (INIT_PROC_ADDR(GetCurrentConsoleFontEx)) {
- CONSOLE_FONT_INFOEX cfi;
- cfi.cbSize = sizeof(cfi);
- if (GetCurrentConsoleFontEx(console, 0, &cfi))
- fontFamily = cfi.FontFamily;
- } else {
- /* pre-Vista: check default console font in registry */
- HKEY hkey;
- if (ERROR_SUCCESS == RegOpenKeyExA(HKEY_CURRENT_USER, "Console",
- 0, KEY_READ, &hkey)) {
- DWORD size = sizeof(fontFamily);
- RegQueryValueExA(hkey, "FontFamily", NULL, NULL,
- (LPVOID) &fontFamily, &size);
- RegCloseKey(hkey);
- }
- }
+ cfi.cbSize = sizeof(cfi);
+ if (GetCurrentConsoleFontEx(console, 0, &cfi))
+ fontFamily = cfi.FontFamily;
if (!(fontFamily & TMPF_TRUETYPE)) {
const wchar_t *msg = L"\nWarning: Your console font probably "
--
gitgitgadget
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] unify and bump _WIN32_WINNT definition to Windows 8.1
2026-04-06 5:45 ` [PATCH v2 0/2] " Johannes Schindelin via GitGitGadget
2026-04-06 5:45 ` [PATCH v2 1/2] " Matthias Aßhauer via GitGitGadget
2026-04-06 5:45 ` [PATCH v2 2/2] compat/winansi: drop pre-Vista workaround Matthias Aßhauer via GitGitGadget
@ 2026-04-06 17:07 ` Junio C Hamano
2 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2026-04-06 17:07 UTC (permalink / raw)
To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> Clean-up while preparing for v2.54.0.
>
> Changes since v1:
>
> * Added a patch I had forgotten to include.
>
> Matthias Aßhauer (2):
> unify and bump _WIN32_WINNT definition to Windows 8.1
> compat/winansi: drop pre-Vista workaround
Thanks. Will apply directly to 'master' ;-)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-06 17:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-05 10:54 [PATCH] unify and bump _WIN32_WINNT definition to Windows 8.1 Johannes Schindelin via GitGitGadget
2026-04-06 5:45 ` [PATCH v2 0/2] " Johannes Schindelin via GitGitGadget
2026-04-06 5:45 ` [PATCH v2 1/2] " Matthias Aßhauer via GitGitGadget
2026-04-06 5:45 ` [PATCH v2 2/2] compat/winansi: drop pre-Vista workaround Matthias Aßhauer via GitGitGadget
2026-04-06 17:07 ` [PATCH v2 0/2] unify and bump _WIN32_WINNT definition to Windows 8.1 Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox