mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
GIOModule: Use unique names for load/unload symbols
GIO modules should include their name into their exported symbols to make them unique. This avoids symbol clash when building modules statically. extract_name() function is copied from GStreamer which recently switched to the same symbol naming scheme. https://bugzilla.gnome.org/show_bug.cgi?id=684282
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "giomodule.h"
|
||||
#include "giomodule-priv.h"
|
||||
|
||||
#include <gstdio.h>
|
||||
#include <errno.h>
|
||||
@@ -83,7 +84,20 @@ query_dir (const char *dirname)
|
||||
|
||||
if (module)
|
||||
{
|
||||
g_module_symbol (module, "g_io_module_query", (gpointer) &query);
|
||||
gchar *modulename;
|
||||
gchar *symname;
|
||||
|
||||
modulename = _g_io_module_extract_name (name);
|
||||
symname = g_strconcat ("g_io_", modulename, "_query", NULL);
|
||||
g_module_symbol (module, symname, (gpointer) &query);
|
||||
g_free (symname);
|
||||
g_free (modulename);
|
||||
|
||||
if (!query)
|
||||
{
|
||||
/* Fallback to old name */
|
||||
g_module_symbol (module, "g_io_module_query", (gpointer) &query);
|
||||
}
|
||||
|
||||
if (query)
|
||||
{
|
||||
|
Reference in New Issue
Block a user