Code compatible to 1.0 and 0.6 - SOLVED -

The following code fails:

if VERSION >= v"0.7.0"
	ccall(:jl_exit_on_sigint, Nothing, (Cint,), 0)
	ccall(:jl_exit_on_sigint, Void, (Cint,), 0)

with the warning on 0.7:

WARNING: Base.Void is deprecated, use Nothing instead.

It fails with an error on 1.0. But why? I am checking for the version.

Any idea?

ccall may be does checking in parsing time or if it is in top node, julia tries to compile both and run conditionally.

Any workaround?

@static if?

1 Like

Thanks, that works. :smile: