-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Transition away from OS-33790456 #5805
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
base: main
Are you sure you want to change the base?
Transition away from OS-33790456 #5805
Conversation
…ons can be naively exported through modules
…building the `std` module To ensure its active under older Windows SDKs, we make sure it runs when `_STATIC_INLINE_UCRT_FUNCTIONS` is not defined. To ensure it's present only when building the `std` module, we check for `_BUILD_STD_MODULE`. Co-authored-by: S. B. Tam <[email protected]>
4c75032 to
8005ad6
Compare
|
Sorry for the force push: I messed up some of the commit text when incorporating feedback through the GitHub UI. |
|
I recommend never using the GitHub UI to make changes; they should always be built and tested locally. (I got burned too many times by introducing validation errors, etc.) Technically I don't care how one makes changes as long as the results are good, but this is my advice to get things right the first time. |
|
@davidmrdavid I have tested your changes with my foundational As you announced, I need to retain the workaround for Despite this sad (and somewhat inconsequential) annoyance, every tested application builds and works, without reaching out to headers from the mentioned libraries. Thanks! |
|
Thanks @DanielaE for the manual test! That's a useful datapoint for us. Agreed that it's unfortunate that a few leftovers remain, such as |
Re-creation of: #5660
As reported in devcomm 1126857, several UCRT functions are declared as
static inline, especially those intime.h.This non-conforming signature prevents us from naively exporting those functions via modules. We have workarounds for this, but they're imperfect.
Thankfully, the October 2025 Windows SDK release (v
10.0.26100.6901) improves on this issue.It exposes a new binary macro
_STATIC_INLINE_UCRT_FUNCTIONS. When set to0, the functions will have 'external linkage' (conforming behavior, compatible with modules) and when set to1, the functions will have static linkage for backwards compatibility.For
MSC_VER_ >= 1950,_STATIC_INLINE_UCRT_FUNCTIONSwill default to0. Otherwise, it'll default to1.This PR consumes the new macro and uses its value to determine whether or not to use our workarounds when building the
stdmodule.Testing
I sense it's probably not worth it to add an automated test for this, but I'm open to be shown otherwise.
I have performed 2 local tests
(1)
In the STL repo, I manually added to the
tests\std\tests\modules_20_matrix.lstthe following diff:Then I ran:
python tests\utils\stl-lit\stl-lit.py ..\..\tests\std\tests\P2465R3_standard_library_modulesTo my knowledge, that allows me to test all modules tests with the UCRT macro toggled on and off. In both cases, there's no regressions in STL functionality.
(2)
In an x64 native tools shell with the October '25 WIndows SDK installed, I tried manually exporting the affected UCRT functions in a module, like so:
As you can see, that worked.
This gives me confidence in the change. But again, I'm open to automated testing. Thanks!