Skip to content

Add more windows time.h functions #4427

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

Merged
merged 1 commit into from
Apr 29, 2025
Merged

Conversation

arihant2math
Copy link
Contributor

@arihant2math arihant2math commented Apr 23, 2025

Description

Adds some windows time functions

Related issue: #1245

Sources

clock_t clock( void );
char *ctime( const time_t *sourceTime );
double difftime( time_t timeEnd, time_t timeStart );
error_t _get_daylight( int* hours );
error_t _get_dstbias( long* seconds );
error_t _get_timezone(long* seconds);
errno_t _get_tzname(
    size_t* pReturnValue,
    char* timeZoneName,
    size_t sizeInBytes,
    int index
);
void _tzset( void );

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see rust-lang/libc#3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Apr 23, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@arihant2math arihant2math changed the title add more windows time.h functions Add more windows time.h functions Apr 23, 2025
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you double check the _wctime link name on windows-gnu? Looks like that is causing a failure

@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Apr 25, 2025
@arihant2math arihant2math requested a review from tgross35 April 27, 2025 05:30
@arihant2math
Copy link
Contributor Author

Yup, removing it fixed the issue.

Copy link
Member

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, And I double checked the signatures. Documentation links, just for the the record:

@tgross35
Copy link
Contributor

Thanks both!

@tgross35 tgross35 enabled auto-merge April 28, 2025 23:24
@tgross35 tgross35 added this pull request to the merge queue Apr 28, 2025
Merged via the queue into rust-lang:main with commit 50a2acf Apr 29, 2025
50 checks passed
@arihant2math arihant2math deleted the windows-time branch April 29, 2025 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants