Skip to content

Voidify getfilesystemtime() #15413

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
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions win32/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
#include <errno.h>
#include "php_win32_globals.h"

static zend_always_inline int getfilesystemtime(struct timeval *tv)
static zend_always_inline void getfilesystemtime(struct timeval *tv)
{/*{{{*/
FILETIME ft;
unsigned __int64 ff = 0;
ULARGE_INTEGER fft;

GetSystemTimePreciseAsFileTime(&ft);

/*
/*
* Do not cast a pointer to a FILETIME structure to either a
* ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows.
* via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx
Expand All @@ -45,8 +45,6 @@ static zend_always_inline int getfilesystemtime(struct timeval *tv)

tv->tv_sec = (long)(ff / 1000000Ui64);
tv->tv_usec = (long)(ff % 1000000Ui64);

return 0;
}/*}}}*/

PHPAPI int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info)
Expand Down
Loading