Skip to content

Commit 6cfc1fd

Browse files
committed
headers: Default NTDDI_VERSION to the latest version, if _WIN32_WINNT targets Windows 10
This matches what WinSDK headers do these days. We always have _WIN32_WINNT set to a default value of our choice, and there's no value we can set _WIN32_WINNT to, that would set NTDDI_VERSION to include the features from newer versions of Windows 10/11, such as e.g. NTDDI_WIN10_RS1. Signed-off-by: Martin Storsjö <[email protected]>
1 parent 5ccc975 commit 6cfc1fd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mingw-w64-headers/include/sdkddkver.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,15 @@
175175
/* Choose NTDDI Version */
176176
#ifndef NTDDI_VERSION
177177
#ifdef _WIN32_WINNT
178+
#if _WIN32_WINNT < _WIN32_WINNT_WIN10
179+
/* For versions before Windows 10, set the corresponding NTDDI_VERSION. */
178180
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
179181
#else
182+
/* As _WIN32_WINNT doesn't distinguish between versions of Windows 10/11,
183+
* set NTDDI_VERSION to the highest version. */
184+
#define NTDDI_VERSION WDK_NTDDI_VERSION
185+
#endif
186+
#else
180187
#define NTDDI_VERSION NTDDI_WS03
181188
#endif
182189
#endif

0 commit comments

Comments
 (0)