Commit Graph
7 Commits
Author SHA1 Message Date
Fabian Fett 148589720a [Windows] Add shims to make string from GetLastError using FormatMessage (#3353)
If we receive a functions error via `GetLastError`, we can stringify it
via `FormatMessage`. Sadly `FormatMessage` isn't auto imported into
Swift, which is why we need to use the shim layer.
2025-08-19 14:31:06 +00:00
Fabian Fett 5dca91e191 [Windows] Make SelectableEventLoop compile (#3344)
- Add overwrite for `write` method that calls undeprecated `_write`
- Add errno global readonly variable
2025-08-13 09:18:50 +00:00
Saleem Abdulrasool 20e63d07dc NIO: extract control message handling into a separate protocol (#1678)
These are part of the BSD sockets APIs, but not directly related to the
socket interfaces.  Create an extension point to permit the different
platforms to shuffle their implementation into place.  This provides a
nicer spelling for the functions and enables the codepaths on Windows as
well.
2020-10-19 16:18:57 +01:00
Saleem Abdulrasool cf9140a686 CNIOWindows: correct declaration (#1646)
This repairs the build on the CNIOWindows module on Windows.  The `NIO`
macro is unavailable in the definition (intentionally) and was being
used accidentally.
2020-09-24 10:29:05 +01:00
Saleem Abdulrasool e183143648 CNIOWindows: add stubs for sendmmsg and recvmmsg (#1645)
These need to be filled out, but lets stub them out for the time being
to get the symbol resolution sorted out.  These are possible to
implement using the WinSDK.
2020-09-23 10:48:02 +01:00
Saleem Abdulrasool 91bde186b2 CNIOWindows: add paranoid preprocessing (NFC) (#1459)
Ensure that this file is only compiled for Windows targets.
2020-03-21 18:20:14 +00:00
Saleem AbdulrasoolandCory Benfield ad419b56d4 NIO: add module constructor for Windows (#1450)
This adds the necessary code to add a module constructor for NIO.  On
Windows, the socketing subsystem (WinSock) must be explicitly
initialized unlike Unices.  Add a module constructor that will be
handled by the C runtime to initialize the subsystem before the module
code is executed so that the user does not need to worry about this.

Since there is no way to inject this in Swift, write a tiny helper in C
and link that into the final NIO binary.

Since swift-package-manager does not support mixed-language directories,
add this to `CNIOWindows` which will need to be statically linked and
must always be imported as `@_implementationOnly` as this cannot be
linked into any user libraries.

Co-authored-by: Cory Benfield <lukasa@apple.com>
2020-03-21 17:51:16 +00:00