Skip to content

Commit

Permalink
Fix compat by copy ismutable def from julia
Browse files Browse the repository at this point in the history
  • Loading branch information
inkydragon committed Dec 14, 2024
1 parent 9f9b4e2 commit b3745ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/manual_wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ gsl_function_helper(x::Cdouble, fn)::Cdouble = fn(x)
# The following code relies on `gsl_function` being a mutable type
# (such that we can call `pointer_from_objref` on it) to simplify the object structure
# a little bit and avoid hitting some limitation of the allocation optimizer.
@static if VERSION >= v"1.5"
@assert ismutable(gsl_function(C_NULL, C_NULL))
@static if VERSION < v"1.5"
# rename isimmutable to ismutable #34652
# https://github.com/JuliaLang/julia/pull/34652
ismutable(@nospecialize(x)) = !isimmutable(x)
else
@assert !isimmutable(gsl_function(C_NULL, C_NULL))
end
@assert ismutable(gsl_function(C_NULL, C_NULL))

function wrap_gsl_function(fn::F) where F
# We need to allocate the `gsl_function` here to be kept alive by ccall
Expand Down

0 comments on commit b3745ff

Please sign in to comment.