Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows XP macro #11018

Merged
merged 2 commits into from
Apr 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions base/osutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,10 @@ end

WINDOWS_XP_VER = (5,1)

macro windowsxp(qm,ex)
_os_test(qm, ex, OS_NAME===:Windows && windows_version() <= WINDOWS_XP_VER)
end

macro windowsxp_only(ex)
@windowsxp? esc(ex) : nothing
_os_test(:?, Expr(:(:), ex, nothing), OS_NAME===:Windows && windows_version() <= WINDOWS_XP_VER)
end

macro non_windowsxp_only(ex)
@windowsxp? nothing : esc(ex)
_os_test(:?, Expr(:(:), nothing, ex), OS_NAME===:Windows && windows_version() <= WINDOWS_XP_VER)
end
4 changes: 2 additions & 2 deletions test/backtrace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ end
dlls = Libdl.dllist()
@test !isempty(dlls)
@test length(dlls) > 3 # at a bare minimum, probably have some version of libstdc, libgcc, libjulia, ...
@test Base.samefile(Libdl.dlpath(dlls[1]), dlls[1])
@test Base.samefile(Libdl.dlpath(dlls[end]), dlls[end])
@non_windowsxp_only @test Base.samefile(Libdl.dlpath(dlls[1]), dlls[1])
@non_windowsxp_only @test Base.samefile(Libdl.dlpath(dlls[end]), dlls[end])
@test length(filter(dlls) do dl
return ismatch(Regex("^libjulia(?:.*)\.$(Libdl.dlext)(?:\..+)?\$"), basename(dl))
end) == 1 # look for something libjulia-like (but only one)
4 changes: 2 additions & 2 deletions test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ccall(:jl_exit_on_sigint, Void, (Cint,), 0)
# in the mix. If verification needs to be done, keep it to the bare minimum. Basically
# this should make sure nothing crashes without depending on how exactly the control
# characters are being used.
begin
@non_windowsxp_only begin
stdin_write, stdout_read, stdout_read, repl = fake_repl()

repl.specialdisplay = Base.REPL.REPLDisplay(repl)
Expand Down Expand Up @@ -235,7 +235,7 @@ end

ccall(:jl_exit_on_sigint, Void, (Cint,), 1)

let exename = joinpath(JULIA_HOME, Base.julia_exename())
@non_windowsxp_only let exename = joinpath(JULIA_HOME, Base.julia_exename())

# Test REPL in dumb mode
@unix_only begin
Expand Down
2 changes: 1 addition & 1 deletion test/socket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ begin
close(a)
close(b)
end
begin
@non_windowsxp_only begin
a = UDPSocket()
b = UDPSocket()
bind(a, ip"::1", UInt16(port))
Expand Down