feat: add support for 32 bit time_t in Windows#5010
Open
dybucc wants to merge 1 commit intorust-lang:mainfrom
Open
feat: add support for 32 bit time_t in Windows#5010dybucc wants to merge 1 commit intorust-lang:mainfrom
time_t in Windows#5010dybucc wants to merge 1 commit intorust-lang:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.All other changes resulted from running
./ci/style.py, so they're not really part of the PR.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