Skip to content

GetSystemTimePreciseAsFileTime() is now always available - #15400

Merged
cmb69 merged 2 commits into
php:masterfrom
cmb69:cmb/GetSystemTimePreciseAsFileTime
Aug 14, 2024
Merged

GetSystemTimePreciseAsFileTime() is now always available#15400
cmb69 merged 2 commits into
php:masterfrom
cmb69:cmb/GetSystemTimePreciseAsFileTime

Conversation

@cmb69

Copy link
Copy Markdown
Member

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

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>

@GirgiasGirgias left a comment

Copy link
Copy Markdown
Member

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 threadwin32/time.c
Comment on lines 26 to 27
static zend_always_inline int getfilesystemtime(struct timeval *tv)
{/*{{{*/

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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:masterAug 14, 2024
@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
adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request Aug 4, 2026
* GetSystemTimePreciseAsFileTime() is now always available
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>
adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request Aug 4, 2026
* Remove php_win32_init_gettimeofday declaration
Follow-up of phpGH-15400 (1ac276f).
* Remove unused header include
* Include php.h before win32/ioutil.h
Sign up for freeto 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

@cmb69@Girgias