Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
31afa4e2 by Steve Lhomme at 2026-01-19T06:59:08+00:00
contrib: libxml2: fix UWP build
- bcrypt was not used due to improper use of WIN32_LEAN_AND_MEAN and
_WIN32_WINNT
- some new desctructor API cannot be used, but we don't need the cleanup on exit
- - - - -
3 changed files:
- +
contrib/src/libxml2/0001-threads-don-t-force-_WIN32_WINNT-to-Vista-if-it-s-se.patch
- + contrib/src/libxml2/0002-globals-don-t-use-destructor-in-UWP-builds.patch
- contrib/src/libxml2/rules.mak
Changes:
=====================================
contrib/src/libxml2/0001-threads-don-t-force-_WIN32_WINNT-to-Vista-if-it-s-se.patch
=====================================
@@ -0,0 +1,43 @@
+From be2080f7a3166ad2ad4a56a5bcd155d3d93fcb56 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <[email protected]>
+Date: Fri, 16 Jan 2026 09:19:01 +0100
+Subject: [PATCH] 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.
+---
+ include/private/threads.h | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/include/private/threads.h b/include/private/threads.h
+index bb187869..823e325e 100644
+--- a/include/private/threads.h
++++ b/include/private/threads.h
+@@ -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
+--
+2.52.0.windows.1
+
=====================================
contrib/src/libxml2/0002-globals-don-t-use-destructor-in-UWP-builds.patch
=====================================
@@ -0,0 +1,27 @@
+From 96a8448b7916707ab85279ee5b3529237569d4be Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <[email protected]>
+Date: Thu, 15 Jan 2026 13:36:39 +0100
+Subject: [PATCH 2/2] globals: don't use destructor in UWP builds
+
+RegisterWaitForSingleObject() and UnregisterWait() are not available in UWP
builds.
+---
+ globals.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/globals.c b/globals.c
+index 8306f94e..d2467760 100644
+--- a/globals.c
++++ b/globals.c
+@@ -80,7 +80,9 @@ static int lineNumbersDefaultValue = 1;
+
+ #ifdef HAVE_WIN32_THREADS
+ #if defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL)
++ #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ #define USE_WAIT_DTOR
++ #endif
+ #else
+ #define USE_DLL_MAIN
+ #endif
+--
+2.52.0.windows.1
+
=====================================
contrib/src/libxml2/rules.mak
=====================================
@@ -36,6 +36,8 @@ endif
libxml2: libxml2-$(LIBXML2_VERSION).tar.xz .sum-libxml2
$(UNPACK)
+ $(APPLY)
$(SRC)/libxml2/0001-threads-don-t-force-_WIN32_WINNT-to-Vista-if-it-s-se.patch
+ $(APPLY)
$(SRC)/libxml2/0002-globals-don-t-use-destructor-in-UWP-builds.patch
$(call pkg_static,"libxml-2.0.pc.in")
$(MOVE)
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/commit/31afa4e2082be62e13e6fe596c7e9608edd72ca0
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/commit/31afa4e2082be62e13e6fe596c7e9608edd72ca0
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits