Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 694903e

Browse files
committed
fixed windows types
1 parent 8fdea56 commit 694903e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/julia-server.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,17 @@ end
146146

147147
function exit_if_atom_dies()
148148

149-
HANDLE = Ptr{Cvoid}
150-
DWORD = UInt32
151-
BOOL = Cint
152-
153149
PROCESS_QUERY_INFORMATION = 0x0400
154150
ERROR_INVALID_PARAMETER = 0x57
155151
STILL_ACTIVE = 259
156152

157153
function CloseHandle(handle)
158-
Base.windowserror(:CloseHandle, 0 == ccall(:CloseHandle, stdcall, Cint, (HANDLE,), handle))
154+
Base.windowserror(:CloseHandle, 0 == ccall(:CloseHandle, stdcall, Cint, (Ptr{Cvoid},), handle))
159155
nothing
160156
end
161157

162158
function OpenProcess(id::Integer, rights = PROCESS_QUERY_INFORMATION)
163-
proc = ccall((:OpenProcess, "kernel32"), stdcall, HANDLE, (DWORD, BOOL, DWORD), rights, false, id)
159+
proc = ccall((:OpenProcess, "kernel32"), stdcall, Ptr{Cvoid}, (UInt32, Cint, UInt32), rights, false, id)
164160
Base.windowserror(:OpenProcess, proc == C_NULL)
165161
proc
166162
end
@@ -183,9 +179,9 @@ function exit_if_atom_dies()
183179
end
184180
end
185181

186-
exitCode = Ref{DWORD}()
182+
exitCode = Ref{UInt32}()
187183

188-
if ccall(:GetExitCodeProcess, stdcall, BOOL, (HANDLE, Ref{DWORD}), hProcess, exitCode) != 0
184+
if ccall(:GetExitCodeProcess, stdcall, Cint, (Ptr{Cvoid}, Ref{UInt32}), hProcess, exitCode) != 0
189185
CloseHandle(hProcess)
190186
if exitCode[] != STILL_ACTIVE
191187
exit()

0 commit comments

Comments
 (0)