1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

threads: don't force _WIN32_WINNT to Vista if it's set to a higher value

This will prevent Universal Windows Platform (UWP) targeting Windows 10+ to fail.
Some UWP API's that are XP/Vista/7 API's are not available in Windows 8 but available in Windows 10.
So if Windows 10 is targetting we should not pretend to build for Windows Vista (0x0600).

If the user didn't set a _WIN32_WINNT value, the Windows SDK/mingw-w64 have a
default value that will be used. We can use sdkddkver.h to get that value.
If the default value is Windows 10 we should not lower it either.
This commit is contained in:
Steve Lhomme
2026-01-16 09:19:01 +01:00
parent deed3b7873
commit 2cc5834033

View File

@@ -7,9 +7,16 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#if _WIN32_WINNT < 0x0600
#undef _WIN32_WINNT
#endif
#else
/* get the default version of the SDK */
#include <sdkddkver.h>
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif
#define _WIN32_WINNT 0x0600
#include <windows.h>
#define HAVE_WIN32_THREADS
#else