feat: add support for 32 bit time_t in Windows#5010
feat: add support for 32 bit time_t in Windows#5010dybucc wants to merge 1 commit intorust-lang:mainfrom
time_t in Windows#5010Conversation
|
What is the point of this? Per @ChrisDenton,
The vast majority of this PR is reformatting, I suspect your local rustfmt isn't picking up .rustfmt.toml for some reason. If there really was that amount of reformatting to do, it should be a separate PR anyway rather than mixed in with other API changes. |
Just ammended the commit without the formatting changes. Adding support for The reason why the PR was opened was because some uses of the Should the PR be altogether closed, or should the changes to add support for |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Are you referring to this? Lines 784 to 785 in 82b7480 If so, the fix here is to deprecate the alias on Windows so we can remove it in 1.0. We don't have any reason to try to support the legacy behavior. |
|
No, the PR only changes types that relied on Still, what's the point of deprecating the EDIT: Sorry, took a while to realize you mean to deprecate |
This commit adds support symmetric to that offered in Linux for using 32-bit `time_t` in Windows. This PR also removes some of the `skip()` functions in Windows, as it renames some symbols to properly reflect whether they are 32-bit or 64-bit compliant, and adds deprecation notices to functions that were are not supported by Microsoft anymore (as per their security guidelines.) There's a few functions that are altogether missing and yet do appear in the Windows CRT docs, but that's work for another PR.
|
The bigger picture is that |
Description
This PR adds support symmetric to that offered in some Unix platforms for using 32-bit
time_tin Windows. This PR also removes some of theskip()functions used withctestin Windows, as it renames some symbols to properly reflect whether they are 32-bit or 64-bit compliant, and adds deprecation notices to functions that are not supported by Microsoft anymore (as per their security guidelines.)There's a few functions with secure variants (suffixed with
_s) that are altogether missing and yet do appear in the Windows CRT docs, but that's work for another PR.In the CI scripts, there seemed to be a slight inconsistency between what the environment variable
ARCH, and the environment variableARCH_BITSwere meant to be checked for, so that also got tweaked.An issue for the deprecation notices hasn't yet been opened, but if the PR seems viable, it can be readily opened before merging.
Sources
_USE_32BIT_TIME_Tis defined.https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/ctime-s-ctime32-s-ctime64-s-wctime-s-wctime32-s-wctime64-s?view=msvc-170
_s-suffixed variants.https://learn.microsoft.com/en-us/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-170
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated