mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 10:42:11 +01:00
According to POSIX, the default behavior of `dlopen` is unspecified when its flags include neither `RTLD_LOCAL` nor `RTLD_GLOBAL`. Consequently, different platforms have different default behavior. The default on Linux is `RTLD_LOCAL`, but the default on Darwin is `RTLD_GLOBAL`. By passing `0` to `dlopen`, this results in the opposite of the caller's intent when using `G_MODULE_BIND_LOCAL`. Passing `RTLD_LOCAL` for `G_MODULE_BIND_LOCAL` allows the correct behavior to be observed regardless of the platform's default.