{"thread":{"id":"65439","subject":"[PATCH] unify and bump _WIN32_WINNT definition to Windows 8.1","startedAt":"2026-04-05T10:54:13Z","lastAt":"2026-04-06T17:07:22Z","messageCount":5,"participants":["Johannes Schindelin via GitGitGadget","Matthias Aßhauer via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"540950","messageId":"pull.2081.git.1775386448854.gitgitgadget@gmail.com","threadId":"65439","inReplyTo":null,"subject":"[PATCH] unify and bump _WIN32_WINNT definition to Windows 8.1","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-04-05T10:54:08Z","receivedAt":"2026-04-05T10:54:13Z","isPatch":true,"body":"From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>\n\nGit for Windows doesn't support anything prior to Windows 8.1 since 2.47.0\nand Git followed along with commits like ce6ccba (mingw: drop Windows\n7-specific work-around, 2025-08-04).\n\nThere is no need to pretend to the compiler that we still support Windows\nVista, just to lock us out of easy access to newer APIs. There is also no\nneed to have conflicting and unused definitions claiming we support some\nversions of Windows XP or even Windows NT 4.0.\n\nBump all definitions of _WIN32_WINNT to a realistic value of Windows 8.1.\nThis will also simplify code for a followup commit that will improve cpu\ncore detection on multi-socket systems.\n\nSigned-off-by: Matthias Aßhauer <mha1993@live.de>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    unify and bump _WIN32_WINNT definition to Windows 8.1\n    \n    A clean-up while preparing for v2.54.0.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2081%2Fdscho%2Fdrop-windows-vista-support-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2081/dscho/drop-windows-vista-support-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2081\n\n compat/mingw.c              | 2 +-\n compat/nedmalloc/malloc.c.h | 2 +-\n compat/poll/poll.c          | 4 ++--\n compat/posix.h              | 2 +-\n compat/win32/flush.c        | 2 ++\n 5 files changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 338ec3535e..2023c16db6 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -2464,7 +2464,7 @@ repeat:\n \tif (supports_file_rename_info_ex) {\n \t\t/*\n \t\t * Our minimum required Windows version is still set to Windows\n-\t\t * Vista. We thus have to declare required infrastructure for\n+\t\t * 8.1. We thus have to declare required infrastructure for\n \t\t * FileRenameInfoEx ourselves until we bump _WIN32_WINNT to\n \t\t * 0x0A00. Furthermore, we have to handle cases where the\n \t\t * FileRenameInfoEx call isn't supported yet.\ndiff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h\nindex 814845d4b3..e0c567586c 100644\n--- a/compat/nedmalloc/malloc.c.h\n+++ b/compat/nedmalloc/malloc.c.h\n@@ -500,7 +500,7 @@ MAX_RELEASE_CHECK_RATE   default: 4095 unless not HAVE_MMAP\n #ifdef WIN32\n #define WIN32_LEAN_AND_MEAN\n #ifndef _WIN32_WINNT\n-#define _WIN32_WINNT 0x403\n+#define _WIN32_WINNT 0x603\n #endif\n #include <windows.h>\n #define HAVE_MMAP 1\ndiff --git a/compat/poll/poll.c b/compat/poll/poll.c\nindex a2becd16cd..ea362b4a8e 100644\n--- a/compat/poll/poll.c\n+++ b/compat/poll/poll.c\n@@ -20,7 +20,7 @@\n \n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n-/* To bump the minimum Windows version to Windows Vista */\n+/* To bump the minimum Windows version to Windows 8.1 */\n #include \"git-compat-util.h\"\n \n /* Tell gcc not to warn about the (nfd < 0) tests, below.  */\n@@ -41,7 +41,7 @@\n #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__\n # define WIN32_NATIVE\n # if defined (_MSC_VER) && !defined(_WIN32_WINNT)\n-#  define _WIN32_WINNT 0x0502\n+#  define _WIN32_WINNT 0x0603\n # endif\n # include <winsock2.h>\n # include <windows.h>\ndiff --git a/compat/posix.h b/compat/posix.h\nindex 3c611d2736..94699a03fa 100644\n--- a/compat/posix.h\n+++ b/compat/posix.h\n@@ -76,7 +76,7 @@\n \n #if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */\n # if !defined(_WIN32_WINNT)\n-#  define _WIN32_WINNT 0x0600\n+#  define _WIN32_WINNT 0x0603\n # endif\n #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */\n #include <winsock2.h>\ndiff --git a/compat/win32/flush.c b/compat/win32/flush.c\nindex 291f90ea94..7244ff69ac 100644\n--- a/compat/win32/flush.c\n+++ b/compat/win32/flush.c\n@@ -6,7 +6,9 @@ int win32_fsync_no_flush(int fd)\n {\n        IO_STATUS_BLOCK io_status;\n \n+#ifndef FLUSH_FLAGS_FILE_DATA_ONLY\n #define FLUSH_FLAGS_FILE_DATA_ONLY 1\n+#endif\n \n        DECLARE_PROC_ADDR(ntdll.dll, NTSTATUS, NTAPI, NtFlushBuffersFileEx,\n \t\t\t HANDLE FileHandle, ULONG Flags, PVOID Parameters, ULONG ParameterSize,\n\nbase-commit: 2855562ca6a9c6b0e7bc780b050c1e83c9fcfbd0\n-- \ngitgitgadget\n"},{"id":"540963","messageId":"pull.2081.v2.git.1775454330.gitgitgadget@gmail.com","threadId":"65439","inReplyTo":"pull.2081.git.1775386448854.gitgitgadget@gmail.com","subject":"[PATCH v2 0/2] unify and bump _WIN32_WINNT definition to Windows 8.1","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-04-06T05:45:28Z","receivedAt":"2026-04-06T05:45:33Z","isPatch":true,"body":"Clean-up while preparing for v2.54.0.\n\nChanges since v1:\n\n * Added a patch I had forgotten to include.\n\nMatthias Aßhauer (2):\n  unify and bump _WIN32_WINNT definition to Windows 8.1\n  compat/winansi: drop pre-Vista workaround\n\n compat/mingw.c              |  2 +-\n compat/nedmalloc/malloc.c.h |  2 +-\n compat/poll/poll.c          |  4 ++--\n compat/posix.h              |  2 +-\n compat/win32/flush.c        |  2 ++\n compat/winansi.c            | 37 ++++---------------------------------\n 6 files changed, 11 insertions(+), 38 deletions(-)\n\n\nbase-commit: 2855562ca6a9c6b0e7bc780b050c1e83c9fcfbd0\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2081%2Fdscho%2Fdrop-windows-vista-support-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2081/dscho/drop-windows-vista-support-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/2081\n\nRange-diff vs v1:\n\n 1:  949696de7a = 1:  949696de7a unify and bump _WIN32_WINNT definition to Windows 8.1\n -:  ---------- > 2:  0b50c30cdd compat/winansi: drop pre-Vista workaround\n\n-- \ngitgitgadget\n"},{"id":"540964","messageId":"949696de7ac069cc98fd6f0d06507635bda7ede6.1775454330.git.gitgitgadget@gmail.com","threadId":"65439","inReplyTo":"pull.2081.v2.git.1775454330.gitgitgadget@gmail.com","subject":"[PATCH v2 1/2] unify and bump _WIN32_WINNT definition to Windows 8.1","fromName":"Matthias Aßhauer via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-04-06T05:45:29Z","receivedAt":"2026-04-06T05:45:35Z","isPatch":true,"body":"From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>\n\nGit for Windows doesn't support anything prior to Windows 8.1 since 2.47.0\nand Git followed along with commits like ce6ccba (mingw: drop Windows\n7-specific work-around, 2025-08-04).\n\nThere is no need to pretend to the compiler that we still support Windows\nVista, just to lock us out of easy access to newer APIs. There is also no\nneed to have conflicting and unused definitions claiming we support some\nversions of Windows XP or even Windows NT 4.0.\n\nBump all definitions of _WIN32_WINNT to a realistic value of Windows 8.1.\nThis will also simplify code for a followup commit that will improve cpu\ncore detection on multi-socket systems.\n\nSigned-off-by: Matthias Aßhauer <mha1993@live.de>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/mingw.c              | 2 +-\n compat/nedmalloc/malloc.c.h | 2 +-\n compat/poll/poll.c          | 4 ++--\n compat/posix.h              | 2 +-\n compat/win32/flush.c        | 2 ++\n 5 files changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 338ec3535e..2023c16db6 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -2464,7 +2464,7 @@ repeat:\n \tif (supports_file_rename_info_ex) {\n \t\t/*\n \t\t * Our minimum required Windows version is still set to Windows\n-\t\t * Vista. We thus have to declare required infrastructure for\n+\t\t * 8.1. We thus have to declare required infrastructure for\n \t\t * FileRenameInfoEx ourselves until we bump _WIN32_WINNT to\n \t\t * 0x0A00. Furthermore, we have to handle cases where the\n \t\t * FileRenameInfoEx call isn't supported yet.\ndiff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h\nindex 814845d4b3..e0c567586c 100644\n--- a/compat/nedmalloc/malloc.c.h\n+++ b/compat/nedmalloc/malloc.c.h\n@@ -500,7 +500,7 @@ MAX_RELEASE_CHECK_RATE   default: 4095 unless not HAVE_MMAP\n #ifdef WIN32\n #define WIN32_LEAN_AND_MEAN\n #ifndef _WIN32_WINNT\n-#define _WIN32_WINNT 0x403\n+#define _WIN32_WINNT 0x603\n #endif\n #include <windows.h>\n #define HAVE_MMAP 1\ndiff --git a/compat/poll/poll.c b/compat/poll/poll.c\nindex a2becd16cd..ea362b4a8e 100644\n--- a/compat/poll/poll.c\n+++ b/compat/poll/poll.c\n@@ -20,7 +20,7 @@\n \n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n-/* To bump the minimum Windows version to Windows Vista */\n+/* To bump the minimum Windows version to Windows 8.1 */\n #include \"git-compat-util.h\"\n \n /* Tell gcc not to warn about the (nfd < 0) tests, below.  */\n@@ -41,7 +41,7 @@\n #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__\n # define WIN32_NATIVE\n # if defined (_MSC_VER) && !defined(_WIN32_WINNT)\n-#  define _WIN32_WINNT 0x0502\n+#  define _WIN32_WINNT 0x0603\n # endif\n # include <winsock2.h>\n # include <windows.h>\ndiff --git a/compat/posix.h b/compat/posix.h\nindex 3c611d2736..94699a03fa 100644\n--- a/compat/posix.h\n+++ b/compat/posix.h\n@@ -76,7 +76,7 @@\n \n #if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */\n # if !defined(_WIN32_WINNT)\n-#  define _WIN32_WINNT 0x0600\n+#  define _WIN32_WINNT 0x0603\n # endif\n #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */\n #include <winsock2.h>\ndiff --git a/compat/win32/flush.c b/compat/win32/flush.c\nindex 291f90ea94..7244ff69ac 100644\n--- a/compat/win32/flush.c\n+++ b/compat/win32/flush.c\n@@ -6,7 +6,9 @@ int win32_fsync_no_flush(int fd)\n {\n        IO_STATUS_BLOCK io_status;\n \n+#ifndef FLUSH_FLAGS_FILE_DATA_ONLY\n #define FLUSH_FLAGS_FILE_DATA_ONLY 1\n+#endif\n \n        DECLARE_PROC_ADDR(ntdll.dll, NTSTATUS, NTAPI, NtFlushBuffersFileEx,\n \t\t\t HANDLE FileHandle, ULONG Flags, PVOID Parameters, ULONG ParameterSize,\n-- \ngitgitgadget\n\n"},{"id":"540965","messageId":"0b50c30cdd97e52212dcbbd13f16632f04258431.1775454330.git.gitgitgadget@gmail.com","threadId":"65439","inReplyTo":"pull.2081.v2.git.1775454330.gitgitgadget@gmail.com","subject":"[PATCH v2 2/2] compat/winansi: drop pre-Vista workaround","fromName":"Matthias Aßhauer via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-04-06T05:45:30Z","receivedAt":"2026-04-06T05:45:36Z","isPatch":true,"body":"From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>\n\n1edeb9a (Win32: warn if the console font doesn't support Unicode,\n2014-06-10) introduced both code to detect the current console font on\nWindows Vista and newer and a fallback for older systems to detect the\ndefault console font and issue a warning if that font doesn't support\nunicode.\n\nSince we haven't supported any Windows older than Vista in almost a\ndecade, we don't need to keep the workaround.\n\nSigned-off-by: Matthias Aßhauer <mha1993@live.de>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/winansi.c | 37 ++++---------------------------------\n 1 file changed, 4 insertions(+), 33 deletions(-)\n\ndiff --git a/compat/winansi.c b/compat/winansi.c\nindex ac2ffb7869..3ce1900939 100644\n--- a/compat/winansi.c\n+++ b/compat/winansi.c\n@@ -32,47 +32,18 @@ static int non_ascii_used = 0;\n static HANDLE hthread, hread, hwrite;\n static HANDLE hconsole1, hconsole2;\n \n-#ifdef __MINGW32__\n-#if !defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 5\n-typedef struct _CONSOLE_FONT_INFOEX {\n-\tULONG cbSize;\n-\tDWORD nFont;\n-\tCOORD dwFontSize;\n-\tUINT FontFamily;\n-\tUINT FontWeight;\n-\tWCHAR FaceName[LF_FACESIZE];\n-} CONSOLE_FONT_INFOEX, *PCONSOLE_FONT_INFOEX;\n-#endif\n-#endif\n-\n static void warn_if_raster_font(void)\n {\n \tDWORD fontFamily = 0;\n-\tDECLARE_PROC_ADDR(kernel32.dll, BOOL, WINAPI,\n-\t\t\tGetCurrentConsoleFontEx, HANDLE, BOOL,\n-\t\t\tPCONSOLE_FONT_INFOEX);\n+\tCONSOLE_FONT_INFOEX cfi;\n \n \t/* don't bother if output was ascii only */\n \tif (!non_ascii_used)\n \t\treturn;\n \n-\t/* GetCurrentConsoleFontEx is available since Vista */\n-\tif (INIT_PROC_ADDR(GetCurrentConsoleFontEx)) {\n-\t\tCONSOLE_FONT_INFOEX cfi;\n-\t\tcfi.cbSize = sizeof(cfi);\n-\t\tif (GetCurrentConsoleFontEx(console, 0, &cfi))\n-\t\t\tfontFamily = cfi.FontFamily;\n-\t} else {\n-\t\t/* pre-Vista: check default console font in registry */\n-\t\tHKEY hkey;\n-\t\tif (ERROR_SUCCESS == RegOpenKeyExA(HKEY_CURRENT_USER, \"Console\",\n-\t\t\t\t0, KEY_READ, &hkey)) {\n-\t\t\tDWORD size = sizeof(fontFamily);\n-\t\t\tRegQueryValueExA(hkey, \"FontFamily\", NULL, NULL,\n-\t\t\t\t\t(LPVOID) &fontFamily, &size);\n-\t\t\tRegCloseKey(hkey);\n-\t\t}\n-\t}\n+\tcfi.cbSize = sizeof(cfi);\n+\tif (GetCurrentConsoleFontEx(console, 0, &cfi))\n+\t\tfontFamily = cfi.FontFamily;\n \n \tif (!(fontFamily & TMPF_TRUETYPE)) {\n \t\tconst wchar_t *msg = L\"\\nWarning: Your console font probably \"\n-- \ngitgitgadget\n"},{"id":"540985","messageId":"xmqqtstoaugo.fsf@gitster.g","threadId":"65439","inReplyTo":"pull.2081.v2.git.1775454330.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 0/2] unify and bump _WIN32_WINNT definition to Windows 8.1","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-04-06T17:07:19Z","receivedAt":"2026-04-06T17:07:22Z","isPatch":true,"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> Clean-up while preparing for v2.54.0.\n>\n> Changes since v1:\n>\n>  * Added a patch I had forgotten to include.\n>\n> Matthias Aßhauer (2):\n>   unify and bump _WIN32_WINNT definition to Windows 8.1\n>   compat/winansi: drop pre-Vista workaround\n\nThanks.  Will apply directly to 'master' ;-)\n"}]}