Code compatible to 1.0 and 0.6 - SOLVED -


#1

The following code fails:

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

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?


#2

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


#3

Any workaround?


#4

@static if?


#5

Thanks, that works. :smile: