Skip to content

[shims] Fix Windows errno() and _stdlib_open #13235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 4, 2017

Conversation

troughton
Copy link
Contributor

_stdlib_getErrno(), _stdlib_setErrno(), and _stdlib_open were failing to compile for Windows.

To address this, correctly define __swift_mode_t on Windows and remove the platform-specific exclusion of errno.h since the Windows 10 SDK provides it.

@@ -183,6 +183,9 @@ char * _Nullable *swift::_stdlib_getEnviron() {
}
#endif

// not Windows
#endif
Copy link
Member

Choose a reason for hiding this comment

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

I realize that this is not your fault, but, while you are here, can you change this please? This should use the following form rather than the preceding // not windows.

#endif // defined(_WIN32) && !defined(__CYGWIN__)

Copy link
Contributor Author

@troughton troughton Dec 3, 2017

Choose a reason for hiding this comment

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

Sure. I've added a comment there. I also thought it made more sense inverted:

// !(defined(_WIN32) && !defined(__CYGWIN__))

since the #endif is actually the end of the #else block, but if you object to that I'll change it to what you originally had.

@compnerd
Copy link
Member

compnerd commented Dec 3, 2017

@swift-ci please test

@compnerd
Copy link
Member

compnerd commented Dec 4, 2017

@swift-ci please test and merge

1 similar comment
@CodaFi
Copy link
Contributor

CodaFi commented Dec 4, 2017

@swift-ci please test and merge

@swift-ci swift-ci merged commit 6cf9ed8 into swiftlang:master Dec 4, 2017
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.

4 participants