Skip to content

Commit

Permalink
ensure ShellExecuteW only gets compiled on windows
Browse files Browse the repository at this point in the history
rather than depending on DCE to delete this code after inference
  • Loading branch information
vtjnash committed Mar 28, 2017
1 parent 9163e67 commit e678e67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions base/interactiveutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ function edit(path::AbstractString, line::Integer=0)
end

if is_windows() && name == "open"
systemerror(:edit, ccall((:ShellExecuteW,"shell32"), stdcall, Int,
(Ptr{Void}, Cwstring, Cwstring, Ptr{Void}, Ptr{Void}, Cint),
C_NULL, "open", path, C_NULL, C_NULL, 10) 32)
@static is_windows() && # don't emit this ccall on other platforms
systemerror(:edit, ccall((:ShellExecuteW, "shell32"), stdcall, Int,
(Ptr{Void}, Cwstring, Cwstring, Ptr{Void}, Ptr{Void}, Cint),
C_NULL, "open", path, C_NULL, C_NULL, 10) 32)
elseif background
spawn(pipeline(cmd, stderr=STDERR))
else
Expand Down

0 comments on commit e678e67

Please sign in to comment.