From f873785a800c3eee989eff66dd8cfab0ffbffb3a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 29 Jul 2024 11:36:49 +0200 Subject: [PATCH] julia_gc: adjust to jl_boundp change in Julia nightly (#5767) --- src/julia_gc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/julia_gc.c b/src/julia_gc.c index 2c13e10d89..d44c69fc5e 100644 --- a/src/julia_gc.c +++ b/src/julia_gc.c @@ -744,6 +744,16 @@ jl_datatype_t * GAP_DeclareBag(jl_sym_t * name, 1, large > 0); } +// internal wrapper for jl_boundp to deal with API change in Julia 1.12 +static int gap_jl_boundp(jl_module_t *m, jl_sym_t *var) +{ +#if JULIA_VERSION_MAJOR == 1 && JULIA_VERSION_MINOR >= 12 + return jl_boundp(m, var, 1); +#else + return jl_boundp(m, var); +#endif +} + // Initialize the integration with Julia's garbage collector; in particular, // create Julia types for use in our allocations. The types will be stored // in the given 'module', and the MPtr type will be a subtype of 'parent'. @@ -792,7 +802,7 @@ void GAP_InitJuliaMemoryInterface(jl_module_t * module, // Julia defines HAVE_JL_REINIT_FOREIGN_TYPE if `jl_reinit_foreign_type` // is available. #ifdef HAVE_JL_REINIT_FOREIGN_TYPE - if (jl_boundp(module, jl_symbol("GapObj"))) { + if (gap_jl_boundp(module, jl_symbol("GapObj"))) { DatatypeGapObj = (jl_datatype_t *)jl_get_global(module, jl_symbol("GapObj")); jl_reinit_foreign_type(DatatypeGapObj, MPtrMarkFunc, NULL);