mirror of
https://github.com/apple/swift-nio.git
synced 2026-05-20 20:30:36 +00:00
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>
5 lines
59 B
Plaintext
5 lines
59 B
Plaintext
module CNIOWindows {
|
|
header "CNIOWindows.h"
|
|
export *
|
|
}
|