Skip to content

Commit 9f9b4e2

Browse files
committed
Fix compat for julia < v1.5
1 parent 6408980 commit 9f9b4e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/manual_wrappers.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ gsl_function_helper(x::Cdouble, fn)::Cdouble = fn(x)
3535
# The following code relies on `gsl_function` being a mutable type
3636
# (such that we can call `pointer_from_objref` on it) to simplify the object structure
3737
# a little bit and avoid hitting some limitation of the allocation optimizer.
38-
@assert ismutable(gsl_function(C_NULL, C_NULL))
38+
@static if VERSION >= v"1.5"
39+
@assert ismutable(gsl_function(C_NULL, C_NULL))
40+
else
41+
@assert !isimmutable(gsl_function(C_NULL, C_NULL))
42+
end
3943

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

0 commit comments

Comments
 (0)