mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
More Unix compatibility: Add "lib" prefix in case the module name doesn't
2001-10-09 Tor Lillqvist <tml@iki.fi> * gmodule-win32.c (_g_module_build_path): More Unix compatibility: Add "lib" prefix in case the module name doesn't already have it, except if it ends with ".dll" (in which case it probably already is the name of an existing DLL). This is needed for instance for the gdk-pixbuf loaders, which are called "lib*.dll", but gdk-pixbuf-io calls g_module_build_path without the "lib" prefix.
This commit is contained in:
parent
a033f12d13
commit
ceea1612c4
@ -1,3 +1,12 @@
|
||||
2001-10-09 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gmodule-win32.c (_g_module_build_path): More Unix compatibility:
|
||||
Add "lib" prefix in case the module name doesn't already have it,
|
||||
except if it ends with ".dll" (in which case it probably already
|
||||
is the name of an existing DLL). This is needed for instance for
|
||||
the gdk-pixbuf loaders, which are called "lib*.dll", but
|
||||
gdk-pixbuf-io calls g_module_build_path without the "lib" prefix.
|
||||
|
||||
2001-10-03 jacob berkman <jacob@ximian.com>
|
||||
|
||||
* libgplugin_a.c: (gplugin_a_module_func):
|
||||
|
@ -249,15 +249,20 @@ _g_module_build_path (const gchar *directory,
|
||||
const gchar *module_name)
|
||||
{
|
||||
gint k;
|
||||
|
||||
|
||||
k = strlen (module_name);
|
||||
|
||||
if (directory && *directory)
|
||||
if (k > 4 && g_strcasecmp (module_name + k - 4, ".dll") == 0)
|
||||
return g_strconcat (directory, G_DIR_SEPARATOR_S, module_name, NULL);
|
||||
else
|
||||
else if (strncmp (module_name, "lib", 3) == 0)
|
||||
return g_strconcat (directory, G_DIR_SEPARATOR_S, module_name, ".dll", NULL);
|
||||
else
|
||||
return g_strconcat (directory, G_DIR_SEPARATOR_S, "lib", module_name, ".dll", NULL);
|
||||
else if (k > 4 && g_strcasecmp (module_name + k - 4, ".dll") == 0)
|
||||
return g_strdup (module_name);
|
||||
else
|
||||
else if (strncmp (module_name, "lib", 3) == 0)
|
||||
return g_strconcat (module_name, ".dll", NULL);
|
||||
else
|
||||
return g_strconcat ("lib", module_name, ".dll", NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user