Skip to content

Commit 3b2e009

Browse files
committed
unify and bump _WIN32_WINNT definition to Windows 8.1
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>
1 parent a5512bd commit 3b2e009

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

compat/mingw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,7 @@ int mingw_rename(const char *pold, const char *pnew)
29382938
if (supports_file_rename_info_ex) {
29392939
/*
29402940
* Our minimum required Windows version is still set to Windows
2941-
* Vista. We thus have to declare required infrastructure for
2941+
* 8.1. We thus have to declare required infrastructure for
29422942
* FileRenameInfoEx ourselves until we bump _WIN32_WINNT to
29432943
* 0x0A00. Furthermore, we have to handle cases where the
29442944
* FileRenameInfoEx call isn't supported yet.

compat/nedmalloc/malloc.c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
500500
#ifdef WIN32
501501
#define WIN32_LEAN_AND_MEAN
502502
#ifndef _WIN32_WINNT
503-
#define _WIN32_WINNT 0x403
503+
#define _WIN32_WINNT 0x603
504504
#endif
505505
#include <windows.h>
506506
#define HAVE_MMAP 1

compat/poll/poll.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#define DISABLE_SIGN_COMPARE_WARNINGS
2222

23-
/* To bump the minimum Windows version to Windows Vista */
23+
/* To bump the minimum Windows version to Windows 8.1 */
2424
#include "git-compat-util.h"
2525

2626
/* Tell gcc not to warn about the (nfd < 0) tests, below. */
@@ -41,7 +41,7 @@
4141
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
4242
# define WIN32_NATIVE
4343
# if defined (_MSC_VER) && !defined(_WIN32_WINNT)
44-
# define _WIN32_WINNT 0x0502
44+
# define _WIN32_WINNT 0x0603
4545
# endif
4646
# include <winsock2.h>
4747
# include <windows.h>

compat/posix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
#if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
8080
# if !defined(_WIN32_WINNT)
81-
# define _WIN32_WINNT 0x0600
81+
# define _WIN32_WINNT 0x0603
8282
# endif
8383
#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
8484
#include <winsock2.h>

compat/win32/flush.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ int win32_fsync_no_flush(int fd)
66
{
77
IO_STATUS_BLOCK io_status;
88

9+
#ifndef FLUSH_FLAGS_FILE_DATA_ONLY
910
#define FLUSH_FLAGS_FILE_DATA_ONLY 1
11+
#endif
1012

1113
DECLARE_PROC_ADDR(ntdll.dll, NTSTATUS, NTAPI, NtFlushBuffersFileEx,
1214
HANDLE FileHandle, ULONG Flags, PVOID Parameters, ULONG ParameterSize,

0 commit comments

Comments
 (0)