Skip to content

GetSystemTimePreciseAsFileTime() is now always available #15400

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 2 commits into from
Aug 14, 2024

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Aug 14, 2024

As of PHP 8.3.0, we require Windows Server 2012 or Windows 8 as bare minimum. Since GetSystemTimePreciseAsFileTime() is always available on these Windows versions[1], there is no more need for the workaround described in dllmain.c; we just can call the function directly.

[1] https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime

cmb69 added 2 commits August 14, 2024 13:06
As of PHP 8.3.0, we require Windows Server 2012 or Windows 8 as bare
minimum.  Since GetSystemTimePreciseAsFileTime() is always available on
these Windows versions[1], there is no more need for the workaround
described in dllmain.c; we just can call the function directly.

[1] <https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM if CI is green.

Comment on lines 26 to 27
static zend_always_inline int getfilesystemtime(struct timeval *tv)
{/*{{{*/
Copy link
Member

Choose a reason for hiding this comment

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

Possible follow-up, this always returns 0 so make it void?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, good catch. See #15413.

@cmb69 cmb69 merged commit 25afbdb into php:master Aug 14, 2024
10 checks passed
@cmb69 cmb69 deleted the cmb/GetSystemTimePreciseAsFileTime branch August 14, 2024 18:00
petk added a commit to petk/php-src that referenced this pull request Aug 16, 2024
petk added a commit that referenced this pull request Aug 17, 2024
* Remove php_win32_init_gettimeofday declaration

Follow-up of GH-15400 (25afbdb).

* Remove unused header include

* Include php.h before win32/ioutil.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants