mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
refactor: explicitly convert HANDLE to intptr_t for _open_osfhandle()
Problem:
The first parameter of "_open_osfhandle()" is an intptr_t; however, a HANDLE is passed.
The official documentation of [_open_osfhandle](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/open-osfhandle) suggests to cast the HANDLE to intptr_t.
MSVC/cl is able to perform an implicit type cast.
However, LLVM/clang-cl will generate an compilation error.
Solution:
Explicitly convert HANDLE to intptr_t for _open_osfhandle().
(cherry picked from commit 63ab3337e0)
This commit is contained in:
committed by
github-actions[bot]
parent
9ad6f0da83
commit
aaee148392
@@ -1683,7 +1683,7 @@ failed:
|
||||
HANDLE conin = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_READ, (LPSECURITY_ATTRIBUTES)NULL,
|
||||
OPEN_EXISTING, 0, (HANDLE)NULL);
|
||||
vim_ignored = _open_osfhandle(conin, _O_RDONLY);
|
||||
vim_ignored = _open_osfhandle((intptr_t)conin, _O_RDONLY);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user