-
Notifications
You must be signed in to change notification settings - Fork 10.5k
WinSDK: explicitly re-export ucrt #35337
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
Conversation
Im not sure how I feel about this. This is roughly similar to say |
This is mostly to make sure the generated Swift interface for WinSDK reflects what symbols are already being exported from it – ucrt contents were exported before this change, but the generated interface didn't indicate that. Exporting CRT rather than ucrt seemed like a good idea to me, but I can narrow it down to just ucrt if you disagree. That would fully solve the issue as well. In practice this means that, for example, code referencing
There's a difference though: UIKit has a Swiftified interface & is supposed to be used directly, while WinSDK would more likely be used via Swifty wrappers rather than directly, due to lots of rough edges caused by automatic C-to-Swift conversion, especially around pointers & strings. |
c64fc09
to
eb2c03f
Compare
If there are simple things that can be done to improve the ergonomics of the WinSDK module, I think that we should consider adding them to the module. The raison d'être of the WinSDK (Swift) module is to ease the use of the clang module, otherwise we wouldn't need the module at all. I just haven't figured out a nice simple adjustment for the interfaces that eases the access. |
ucrt symbols are already implicitly available after an `import WinSDK` statement, however, WinSDK generated Swift interface does not indicate that. Besides, WinSDK Swift overlay uses `time_t` in its public interface, which is declared in ucrt, but there is no corresponding import statement. This change adds the import statement, to make the dependencies & exports more clear for the users, and to help with IDE integration.
eb2c03f
to
07c723a
Compare
Oh that's a fair point, I didn't realize that. Switched the import to just
I'm not sure it's possible to avoid exporting |
The My concern with this is just that the WinSDK module should not be vending the C library is all. |
@swift-ci please smoke test |
ucrt symbols are already implicitly available after an
import WinSDK
statement, however, WinSDK generated Swift interface does not indicate that.Besides, WinSDK Swift overlay uses
time_t
in its public interface, which is declared in ucrt, but there is no corresponding import statement.This change adds the import statement, to make the dependencies & exports more clear for the users, and to help with IDE integration.
The generated Swift interface for WinSDK after this change contains an
import ucrt
statement.