Skip to content

Commit e50b81f

Browse files
committed
Fix breakage on 0.5-dev due to filesystem cleanup. JuliaLang/julia#12819
1 parent bf8b733 commit e50b81f

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ environment:
22
matrix:
33
- JULIAVERSION: "julialang/bin/winnt/x86/0.3/julia-0.3-latest-win32.exe"
44
- JULIAVERSION: "julialang/bin/winnt/x64/0.3/julia-0.3-latest-win64.exe"
5+
- JULIAVERSION: "julialang/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe"
6+
- JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe"
57
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
68
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
79

src/ZMQ.jl

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ if VERSION >= v"0.4.0-dev+3844"
1616
else
1717
using Base: EAGAIN
1818
end
19+
if VERSION >= v"0.5.0-dev+1229"
20+
import Base.Filesystem: UV_READABLE, uv_pollcb
21+
else
22+
import Base: UV_READABLE
23+
if isdefined(Base, :uv_pollcb)
24+
import Base: uv_pollcb
25+
end
26+
end
1927

2028
const depfile = joinpath(dirname(@__FILE__),"..","deps","deps.jl")
2129
if isfile(depfile)
@@ -61,7 +69,11 @@ function jl_zmq_error_str()
6169
end
6270
end
6371

64-
if VERSION >= v"0.4-" && isdefined(Base,:_FDWatcher)
72+
if VERSION >= v"0.5-" && isdefined(Base, :Filesystem)
73+
@windows_only using Base.Libc: WindowsRawSocket
74+
const _FDWatcher = Base.Filesystem._FDWatcher
75+
const _have_good_fdwatcher = true
76+
elseif VERSION >= v"0.4-" && isdefined(Base, :_FDWatcher)
6577
@windows_only using Base.Libc: WindowsRawSocket
6678
const _FDWatcher = Base._FDWatcher
6779
const _have_good_fdwatcher = true
@@ -251,13 +263,16 @@ end
251263

252264
# Raw FD access
253265
@unix_only fd(socket::Socket) = RawFD(get_fd(socket))
254-
@windows_only fd(socket::Socket) = WindowsRawSocket(convert(Ptr{Void}, get_fd(socket)))
266+
@windows_only fd(socket::Socket) = WindowsRawSocket(convert(Ptr{Void},
267+
get_fd(socket)))
255268
if _have_good_fdwatcher
256269
wait(socket::Socket) = wait(socket.pollfd, readable=true, writable=false)
257-
notify(socket::Socket) = Base.uv_pollcb(socket.pollfd.handle, Int32(0), Int32(Base.UV_READABLE))
270+
notify(socket::Socket) = uv_pollcb(socket.pollfd.handle, Int32(0),
271+
Int32(UV_READABLE))
258272
else
259273
wait(socket::Socket) = Base._wait(socket.pollfd, #=readable=#true, #=writable=#false)
260-
notify(socket::Socket) = Base._uv_hook_pollcb(socket.pollfd, int32(0), int32(Base.UV_READABLE))
274+
notify(socket::Socket) = Base._uv_hook_pollcb(socket.pollfd, int32(0),
275+
int32(UV_READABLE))
261276
end
262277

263278
# Socket options of string type

0 commit comments

Comments
 (0)