Skip to content

Conversation

@compnerd
Copy link
Collaborator

Windows does not have the same set of error codes as a POSIX system.
However, the WinSock subsystem provides a set of error codes which are
meant to provide a means for handling similar error scenarios with
sockets. This additionally adds an additional error code which allows
us to add back a previously ignored error code.

@compnerd
Copy link
Collaborator Author

@swift-ci please test

@compnerd
Copy link
Collaborator Author

Note that this is not entirely semantically equivalent. The errors mapped here are not valid in all contexts but rather are limited to the context of calls to the WinSock subsystem.

Windows does not have the same set of error codes as a POSIX system.
However, the WinSock subsystem provides a set of error codes which are
meant to provide a means for handling similar error scenarios with
sockets.  This additionally adds an additional error code which allows
us to add back a previously ignored error code.
@compnerd
Copy link
Collaborator Author

@swift-ci please test

Copy link
Contributor

@milseman milseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Out of curiosity, how was ESOCKTNOSUPPORT compiling before this change?

@compnerd
Copy link
Collaborator Author

I don't believe that it was. I believe that it was added after the initial port, and because there is no CI, we never noticed that we broke the build. There were a few instances of that. However, once a CMake based build is in place, I can easily setup a nightly build job to build Swift System on Windows, and should even be able to kick off one-offs with a patch if desired.

@milseman
Copy link
Contributor

Ah, that was because we were hand-declaring them with the int literals instead of the module constants: 4ffcc62#diff-0ee5719a7e727f19909c8ae438eb8ad3e0cdaa454fc4e1e51cea56f34feec8c1R214

@milseman
Copy link
Contributor

@swift-ci please test linux platform

@milseman milseman merged commit dd1da29 into apple:main Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants