glib/gmodule
Nirbheek Chauhan d941558ee9 Improve g_module_open(), deprecate G_MODULE_SUFFIX
G_MODULE_SUFFIX is deprecated now because you will get the wrong
results using it most of the time:

1. The suffix on macOS is usually 'dylib', but it's 'so' when using
   Autotools, so there's no way to get the suffix correct using
   a pre-processor macro.
2. Prefixes also vary in a platform-specific way. You may or may not have
   a 'lib' prefix for the name on Windows and on Cygwin the prefix is
   'cyg'.
3. The library name itself can vary per platform. For instance, you may
   want to load foo-1.dll on Windows and libfoo.1.dylib on macOS. This
   is for libraries, not modules, but that is still a use-case that
   people use the GModule API for.

g_module_build_path() does take care of (2) on Cygwin, but it
fundamentally cannot handle the possibility of multiple options for
the module name, since it does not do any I/O. Hence, it is also
deprecated.

Instead, g_module_open() has been improved so that it takes care of
all this by searching the filesystem for combinations of possible
suffixes and prefixes on each platform. Along the way, the
documentation for it was also improved to make it clearer what it
does.

Closes https://gitlab.gnome.org/GNOME/glib/-/issues/520

Closes https://gitlab.gnome.org/GNOME/glib/-/issues/1413
2022-10-27 20:26:53 +05:30
..
tests Merge branch 'wip/smcv/deprecated-prop-followup' into 'main' 2022-10-15 21:31:29 +00:00
AUTHORS initial import of gmodule. 1998-08-09 08:32:18 +00:00
COPYING docs: Add all used licenses in a REUSE-compatible directory 2022-05-17 17:23:34 +01:00
gmodule-ar.c Improve g_module_open(), deprecate G_MODULE_SUFFIX 2022-10-27 20:26:53 +05:30
gmodule-deprecated.c Improve g_module_open(), deprecate G_MODULE_SUFFIX 2022-10-27 20:26:53 +05:30
gmodule-dl.c Improve g_module_open(), deprecate G_MODULE_SUFFIX 2022-10-27 20:26:53 +05:30
gmodule-win32.c Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
gmodule.c Improve g_module_open(), deprecate G_MODULE_SUFFIX 2022-10-27 20:26:53 +05:30
gmodule.h Improve g_module_open(), deprecate G_MODULE_SUFFIX 2022-10-27 20:26:53 +05:30
gmodule.rc.in meson: build Windows resource files 2018-01-04 22:19:30 +01:00
gmoduleconf.h.in Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
meson.build Improve g_module_open(), deprecate G_MODULE_SUFFIX 2022-10-27 20:26:53 +05:30