summaryrefslogtreecommitdiff
path: root/gio/giomodule.h
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2017-11-30 15:36:21 -0500
committerXavier Claessens <xavier.claessens@collabora.com>2018-01-04 11:01:40 -0500
commit7f69b828fcf952fac9cb27da1e74b2fdffa997d0 (patch)
tree10b5b8cfb6eff30646099b12cf3e73feefd87d73 /gio/giomodule.h
parente91c11841808ccca408da96136f433a82b2e2145 (diff)
downloadglib-7f69b828fcf952fac9cb27da1e74b2fdffa997d0.tar.gz
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
Diffstat (limited to 'gio/giomodule.h')
-rw-r--r--gio/giomodule.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/gio/giomodule.h b/gio/giomodule.h
index 485f5eb9f..e94b8099d 100644
--- a/gio/giomodule.h
+++ b/gio/giomodule.h
@@ -112,6 +112,14 @@ GTypeClass* g_io_extension_ref_class (GIOExtension
* This function is run after the module has been loaded into GIO,
* to initialize the module. Typically, this function will call
* g_io_extension_point_implement().
+ *
+ * Since 2.56, this function should be named `g_io_<modulename>_load`, where
+ * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
+ * everything after the first dot removed, and with `-` replaced with `_`
+ * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
+ * Using the new symbol names avoids name clashes when building modules
+ * statically. The old symbol names continue to be supported, but cannot be used
+ * for static builds.
**/
GLIB_AVAILABLE_IN_ALL
void g_io_module_load (GIOModule *module);
@@ -124,6 +132,14 @@ void g_io_module_load (GIOModule *module);
*
* This function is run when the module is being unloaded from GIO,
* to finalize the module.
+ *
+ * Since 2.56, this function should be named `g_io_<modulename>_unload`, where
+ * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
+ * everything after the first dot removed, and with `-` replaced with `_`
+ * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
+ * Using the new symbol names avoids name clashes when building modules
+ * statically. The old symbol names continue to be supported, but cannot be used
+ * for static builds.
**/
GLIB_AVAILABLE_IN_ALL
void g_io_module_unload (GIOModule *module);
@@ -155,6 +171,14 @@ void g_io_module_unload (GIOModule *module);
* run gio-querymodules in order to build the cache files required for
* lazy loading.
*
+ * Since 2.56, this function should be named `g_io_<modulename>_query`, where
+ * `modulename` is the plugin’s filename with the `lib` or `libgio` prefix and
+ * everything after the first dot removed, and with `-` replaced with `_`
+ * throughout. For example, `libgiognutls-helper.so` becomes `gnutls_helper`.
+ * Using the new symbol names avoids name clashes when building modules
+ * statically. The old symbol names continue to be supported, but cannot be used
+ * for static builds.
+ *
* Returns: (transfer full): A %NULL-terminated array of strings,
* listing the supported extension points of the module. The array
* must be suitable for freeing with g_strfreev().