mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
This adjusts the use of Dispatch to build on Windows. Windows does not provide `stdout_fileno` and `stderr_fileno`. However, it is possible to use `fileno` to get the associated fileno from the descriptor. Dispatch on Windows does not deal with fd's but rather with handles. Convert the file descriptor to a handle and pass that off to dispatch. The handle is a non-owning reference, and should not be closed. Fortunately, dispatch does not close the handle when the DispatchIO is closed.