-
Notifications
You must be signed in to change notification settings - Fork 10.5k
WinSDK: extract System submodule #34147
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
link "DbgHelp.Lib" | ||
} | ||
|
||
module IOCtl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind naming this IOCTL
to match https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some general rule for naming these modules? I imagine me writing something in Swift and thinking "Ok, MSDN says that these API are defined in winioctl.h, but what import do I need to add?"
At this point it looks easier to just look into modulemap and search for corresponding module.
I am torn between Swiftified module names and "platformish" MSDN-inspired names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lxbndr
From the compilation POV it doesn't really matter which import you add, since all of the submodules are represented by a single underlying Clang module, so importing any submodule (or the entire WinSDK
) implicitly imports them all.
From the convenience POV when writing the imports, as you've pointed out, looking for a specific submodule names might be frustrating, if you prefer them over importing the entire module. Ideally your IDE or editor would automatically insert the desired import depending on your preference though, and you wouldn't have to remember the submodule names.
When reading the imports, especially by someone who isn't an expert in the Windows API naming & structure, Swifty names IMO would be easier to understand than some cryptic Windows abbreviations.
There was also a related discussion in #33929, where @compnerd was in favor of the MSDN section names, which don't usually match the header names, and are closer to the Swifty names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egorzhdan Oh, thanks for pointing on that discussion. Compnerd's suggestion has sense.
Currently this header gets included into `WinSDK.WinSock2` via windows.h & winscard.h
055c4d9
to
ae9715a
Compare
@swift-ci please smoke test |
@swift-ci please test |
@swift-ci please test Windows platform |
@swift-ci please test Windows Platform |
Currently
winioctl.h
header gets included intoWinSDK.WinSock2
viawindows.h
&winscard.h
.MSDN lists this header in https://docs.microsoft.com/en-us/windows/win32/api/_base/ along with
DbgHelp.h
, so this change also movesWinSDK.DbgHelp
to the System submodule.