From 0498cac1f9379e73ce31ff0b0080011bc5a28a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20L=C3=B6tscher?= Date: Thu, 19 Dec 2024 07:19:01 +0100 Subject: [PATCH] Fix core_module on MacOS for GLIB >= 2.76 --- lgi/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lgi/core.c b/lgi/core.c index 0e0edb21..44070bf2 100644 --- a/lgi/core.c +++ b/lgi/core.c @@ -556,10 +556,15 @@ core_module (lua_State *L) luaL_checkstring (L, 1)); #if defined(__APPLE__) +/* GLib 2.76 improved g_module_open() on MacOS, see + https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2950. For + older GLib versions, use the previous workaround. */ +#if !GLIB_CHECK_VERSION(2, 76, 0) char *path = g_module_build_path (GOBJECT_INTROSPECTION_LIBDIR, name); g_free(name); name = path; +#endif #endif /* Try to load the module. */