Merge branch 'nirbheek/preliminary-uwp-support' into 'master'

Preliminary patches for Universal Windows Platform support

See merge request GNOME/glib!951
This commit is contained in:
LRN 2019-06-27 16:08:59 +00:00
commit 5e7c18fa48
2 changed files with 15 additions and 1 deletions

View File

@ -408,7 +408,7 @@ registry_cache_add_item (GNode *parent,
item->block_count = 0;
item->readable = FALSE;
trace ("\treg cache: adding %s to %s\n",
trace ("\tregistry cache: adding %s to %s\n",
name, ((RegistryCacheItem *)parent->data)->name);
cache_node = g_node_new (item);

View File

@ -39,6 +39,12 @@
#include <sys/cygwin.h>
#endif
/* Default family is DESKTOP_APP which is DESKTOP | APP
* We want to know when we're only building for apps */
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define G_WINAPI_ONLY_APP
#endif
static void
set_error (const gchar *format,
...)
@ -84,7 +90,15 @@ _g_module_open (const gchar *file_name,
success = SetThreadErrorMode (SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS, &old_mode);
if (!success)
set_error ("");
/* When building for UWP, load app asset DLLs instead of filesystem DLLs.
* Needs MSVC, Windows 8 and newer, and is only usable from apps. */
#if _WIN32_WINNT >= 0x0602 && defined(G_WINAPI_ONLY_APP)
handle = LoadPackagedLibrary (wfilename, 0);
#else
handle = LoadLibraryW (wfilename);
#endif
if (success)
SetThreadErrorMode (old_mode, NULL);
g_free (wfilename);