gio: Also support modules built with MSVC

GIO modules built with MSVC do not begin with 'lib', but they can
begin with 'gio'. Without this, you can only load GIO modules built
with MSVC that are `name.dll`, not `gioname.dll`.
This commit is contained in:
Nirbheek Chauhan 2019-02-20 20:48:33 +05:30
parent 9aab30641e
commit 8e3fc7dfaa

View File

@ -51,7 +51,8 @@ _g_io_module_extract_name (const char *filename)
if (g_str_has_prefix (bname, "libgio"))
prefix_len = 6;
else if (g_str_has_prefix (bname, "lib"))
/* DLLs built with MSVC generally do not have the 'lib' prefix */
else if (g_str_has_prefix (bname, "lib") || g_str_has_prefix (bname, "gio"))
prefix_len = 3;
else
prefix_len = 0; /* use whole name (minus suffix) as plugin name */