Skip to content

Commit a412921

Browse files
authored
Merge pull request #331 from rolandlo/fix-core_module
Fix core_module on MacOS for GLIB >= 2.76
2 parents 8e49fba + 0498cac commit a412921

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lgi/core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,15 @@ core_module (lua_State *L)
556556
luaL_checkstring (L, 1));
557557

558558
#if defined(__APPLE__)
559+
/* GLib 2.76 improved g_module_open() on MacOS, see
560+
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2950. For
561+
older GLib versions, use the previous workaround. */
562+
#if !GLIB_CHECK_VERSION(2, 76, 0)
559563
char *path = g_module_build_path (GOBJECT_INTROSPECTION_LIBDIR,
560564
name);
561565
g_free(name);
562566
name = path;
567+
#endif
563568
#endif
564569

565570
/* Try to load the module. */

0 commit comments

Comments
 (0)