Skip to content

Commit

Permalink
Fix deprecation warnings on 0.4
Browse files Browse the repository at this point in the history
Qualify Libdl.dlopen, dlsym_e

Fix #24
  • Loading branch information
jiahao committed Apr 6, 2015
1 parent df5704c commit a01a29b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/GZip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ gzread(s::GZipStream, p::Ptr, len::Integer) =
s.gz_file, p, len),
-1)

let _zlib_h = dlopen(_zlib)
let _zlib_h = Libdl.dlopen(_zlib)
global gzbuffer, _gzopen, _gzseek, _gztell

# Doesn't exist in zlib 1.2.3 or earlier
if dlsym_e(_zlib_h, :gzbuffer) != C_NULL
if Libdl.dlsym_e(_zlib_h, :gzbuffer) != C_NULL
gzbuffer(gz_file::Ptr, gz_buf_size::Integer) =
ccall((:gzbuffer, _zlib), Int32, (Ptr{Void}, UInt32), gz_file, gz_buf_size)
else
Expand All @@ -215,7 +215,7 @@ let _zlib_h = dlopen(_zlib)

# Use 64-bit functions if available

if dlsym_e(_zlib_h, :gzopen64) != C_NULL
if Libdl.dlsym_e(_zlib_h, :gzopen64) != C_NULL
const _gzopen = :gzopen64
const _gzseek = :gzseek64
const _gztell = :gztell64
Expand Down
4 changes: 2 additions & 2 deletions src/zlib_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ const SEEK_CUR = @compat Int32(1)
# Get compile-time option flags
zlib_compile_flags = ccall((:zlibCompileFlags, _zlib), UInt, ())

let _zlib_h = dlopen(_zlib)
let _zlib_h = Libdl.dlopen(_zlib)
global ZFileOffset

z_off_t_sz = 2 << ((zlib_compile_flags >> 6) & @compat(UInt(3)))
if z_off_t_sz == sizeof(FileOffset) ||
(sizeof(FileOffset) == 8 && dlsym_e(_zlib_h, :gzopen64) != C_NULL)
(sizeof(FileOffset) == 8 && Libdl.dlsym_e(_zlib_h, :gzopen64) != C_NULL)
typealias ZFileOffset FileOffset
elseif z_off_t_sz == 4 # 64-bit functions not available
typealias ZFileOffset Int32
Expand Down

0 comments on commit a01a29b

Please sign in to comment.