mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
changes FileHandle type on Windows (#24910)
On windows, `HANDLE` type values are converted to `syncio.FileHandle` in `lib/std/syncio.nim`, `lib/pure/memfiles.nim` and `lib/pure/osproc.nim`. `HANDLE` type is `void *` on Windows and its size is larger then `cint`. https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types This PR change `syncio.FileHandle` type so that converting `HANDLE` type to `syncio.FileHandle` doesn't lose bits. We can keep `FileHandle` unchanged and change some of parameter/return type from `FileHandle` to an type same size to `HANDLE`, but it is breaking change.
This commit is contained in:
@@ -815,7 +815,7 @@ proc WSASendTo*(s: SocketHandle, buf: ptr TWSABuf, bufCount: DWORD,
|
||||
completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {.
|
||||
stdcall, importc: "WSASendTo", dynlib: "Ws2_32.dll".}
|
||||
|
||||
proc get_osfhandle*(fd:FileHandle): Handle {.
|
||||
proc get_osfhandle*(fd: cint): Handle {.
|
||||
importc: "_get_osfhandle", header:"<io.h>".}
|
||||
|
||||
proc getSystemTimes*(lpIdleTime, lpKernelTime,
|
||||
|
||||
Reference in New Issue
Block a user