summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-07-09 00:08:18 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-07-09 00:10:13 +0530
commit71486c167e8b4f0a989b0ad78174fddf7d364f73 (patch)
tree378f5316ec14f73236dbbed802c4bb90ff7cd04d
parentd0c23a4f9aea9affd2cbe8f3dd4aa5d0df9fc422 (diff)
glib.recipe: Don't wait for Window Messages on UWP
This function is not available UWP, and WaitForMultipleObjects should be used instead since Win32 Window Messages are not available on UWP. This error was reported by the Windows Application Certification Kit (WACK). Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/545>
-rw-r--r--recipes/glib.recipe1
-rw-r--r--recipes/glib/uwp/0001-gpoll-UWP-does-not-need-to-poll-a-msg_fd.patch50
2 files changed, 51 insertions, 0 deletions
diff --git a/recipes/glib.recipe b/recipes/glib.recipe
index e148a7c7..6de7aeaf 100644
--- a/recipes/glib.recipe
+++ b/recipes/glib.recipe
@@ -137,6 +137,7 @@ class Recipe(recipe.Recipe):
self.patches += [
# Ready to upstream
'glib/uwp/0001-glib-Never-use-MessageBox-on-UWP-apps.patch',
+ 'glib/uwp/0001-gpoll-UWP-does-not-need-to-poll-a-msg_fd.patch',
'glib/uwp/0001-gio-Remove-broken-support-for-XP.patch',
'glib/uwp/0002-win_iconv-Use-LoadPackagedLibrary-when-building-UWP-.patch',
'glib/uwp/0003-glib-getpid-is-available-on-Win32-but-not-WinRT.patch',
diff --git a/recipes/glib/uwp/0001-gpoll-UWP-does-not-need-to-poll-a-msg_fd.patch b/recipes/glib/uwp/0001-gpoll-UWP-does-not-need-to-poll-a-msg_fd.patch
new file mode 100644
index 00000000..e95c5ece
--- /dev/null
+++ b/recipes/glib/uwp/0001-gpoll-UWP-does-not-need-to-poll-a-msg_fd.patch
@@ -0,0 +1,50 @@
+From 029fc2872786dba06ca5a85294419eb229e080e9 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@centricular.com>
+Date: Thu, 9 Jul 2020 00:04:22 +0530
+Subject: [PATCH] gpoll: UWP does not need to poll a msg_fd
+
+msg_fd is only set when we need to handle win32 Window Messages, which
+are not available when building with UWP.
+---
+ glib/gpoll.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/glib/gpoll.c b/glib/gpoll.c
+index 290c64c..524fd39 100644
+--- a/glib/gpoll.c
++++ b/glib/gpoll.c
+@@ -149,8 +149,15 @@ poll_rest (GPollFD *msg_fd,
+ if (_g_main_poll_debug)
+ g_print (" MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout_ms);
+
++#ifdef G_WINAPI_ONLY_APP
++ /* msg_fd is only set when we need to handle win32 Window Messages, which
++ * are not available when building with UWP
++ */
++ g_assert_not_reached ();
++#else
+ ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout_ms,
+ QS_ALLINPUT, MWMO_ALERTABLE);
++#endif
+
+ if (ready == WAIT_FAILED)
+ {
+@@ -447,8 +454,15 @@ g_poll (GPollFD *fds,
+
+ /* Wait for at least one thread to return */
+ if (msg_fd != NULL)
++#ifdef G_WINAPI_ONLY_APP
++ /* msg_fd is only set when we need to handle win32 Window Messages, which
++ * are not available when building with UWP
++ */
++ g_assert_not_reached ();
++#else
+ ready = MsgWaitForMultipleObjectsEx (nthreads, thread_handles, timeout,
+ QS_ALLINPUT, MWMO_ALERTABLE);
++#endif
+ else
+ ready = WaitForMultipleObjects (nthreads, thread_handles, timeout > 0, timeout);
+
+--
+2.27.0.windows.1
+