Skip to content

Commit

Permalink
Fix deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
femtocleaner[bot] committed Jul 9, 2018
1 parent 30105a7 commit 9bcf776
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions src/Rmath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,14 @@ end
export dwilcox,pwilcox,qwilcox,rwilcox # Wilcox's Rank Sum statistic (m, n)
export ptukey, qtukey # Studentized Range Distribution - p and q only

@static if VERSION v"0.7.0-DEV.4749"
function __init__()
# initialize RNG hooks
unsafe_store!(cglobal((:unif_rand_ptr,libRmath),Ptr{Cvoid}),
@cfunction(rand,Float64,()))
unsafe_store!(cglobal((:norm_rand_ptr,libRmath),Ptr{Cvoid}),
@cfunction(randn,Float64,()))
unsafe_store!(cglobal((:exp_rand_ptr,libRmath),Ptr{Cvoid}),
@cfunction(Random.randexp,Float64,()))
end
else
function __init__()
# initialize RNG hooks
unsafe_store!(cglobal((:unif_rand_ptr,libRmath),Ptr{Cvoid}),
cfunction(rand,Float64,Tuple{}))
unsafe_store!(cglobal((:norm_rand_ptr,libRmath),Ptr{Cvoid}),
cfunction(randn,Float64,Tuple{}))
unsafe_store!(cglobal((:exp_rand_ptr,libRmath),Ptr{Cvoid}),
cfunction(Random.randexp,Float64,Tuple{}))
end
function __init__()
# initialize RNG hooks
unsafe_store!(cglobal((:unif_rand_ptr,libRmath),Ptr{Cvoid}),
@cfunction(rand,Float64,()))
unsafe_store!(cglobal((:norm_rand_ptr,libRmath),Ptr{Cvoid}),
@cfunction(randn,Float64,()))
unsafe_store!(cglobal((:exp_rand_ptr,libRmath),Ptr{Cvoid}),
@cfunction(Random.randexp,Float64,()))
end

## Macro for deferring freeing data until GC for wilcox and signrank
Expand Down

0 comments on commit 9bcf776

Please sign in to comment.