[glib: 1/3] gio: Also support modules built with MSVC



commit 8e3fc7dfaa2c383f1cdc3c6571eb206b346841b1
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Wed Feb 20 20:48:33 2019 +0530

    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`.

 gio/giomodule-priv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gio/giomodule-priv.c b/gio/giomodule-priv.c
index 41afa54a0..d4ddd3645 100644
--- a/gio/giomodule-priv.c
+++ b/gio/giomodule-priv.c
@@ -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 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]