Skip to content

Commit

Permalink
Merge pull request #59 from JuliaStats/fbot/deps
Browse files Browse the repository at this point in the history
Fix deprecations
  • Loading branch information
dmbates authored Jul 10, 2018
2 parents 30105a7 + 9bcf776 commit 5ad9daf
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 5ad9daf

Please sign in to comment.