Skip to content

Commit

Permalink
julia_gc: adjust to jl_boundp change in Julia nightly (#5767)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Jul 29, 2024
1 parent 888ff6a commit f873785
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/julia_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f873785

Please sign in to comment.