diff options
author | nightwalker-87 <15526941+Nightwalker-87@users.noreply.github.com> | 2024-02-01 00:01:58 +0100 |
---|---|---|
committer | nightwalker-87 <15526941+Nightwalker-87@users.noreply.github.com> | 2024-02-01 00:01:58 +0100 |
commit | 40948aa3de78778f51af02d795327ac20fa385d3 (patch) | |
tree | b2c46fa5d48d1c12a3b1f95f93917bbba6405a2e /src/win32/sys_time.c | |
parent | e662da00ca294c874655c65cffae3edde97343e5 (diff) | |
parent | 133c2564dee478ed2fcf634ae217441ac723b3e3 (diff) |
Merge remote-tracking branch 'origin/develop'v1.8.0origin/mastermasterfor-upstream
Diffstat (limited to 'src/win32/sys_time.c')
-rw-r--r-- | src/win32/sys_time.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/win32/sys_time.c b/src/win32/sys_time.c index 08da60b..f1ebd63 100644 --- a/src/win32/sys_time.c +++ b/src/win32/sys_time.c @@ -1,3 +1,5 @@ +#include <stdint.h> + #include "sys_time.h" #ifndef STLINK_HAVE_SYS_TIME_H @@ -5,21 +7,21 @@ #include <time.h> /* Simple gettimeofday implementation without converting Windows time to Linux time */ -int gettimeofday(struct timeval *tv, struct timezone *tz) { +int32_t gettimeofday(struct timeval *tv, struct timezone *tz) { FILETIME ftime; ULARGE_INTEGER ulint; - static int tzflag = 0; + static int32_t tzflag = 0; - if(NULL != tv) { + if (NULL != tv) { GetSystemTimeAsFileTime(&ftime); ulint.LowPart = ftime.dwLowDateTime; ulint.HighPart = ftime.dwHighDateTime; - tv->tv_sec = (long)(ulint.QuadPart / 10000000L); - tv->tv_usec = (long)(ulint.QuadPart % 10000000L); + tv->tv_sec = (int32_t)(ulint.QuadPart / 10000000L); + tv->tv_usec = (int32_t)(ulint.QuadPart % 10000000L); } - if(NULL != tz) { + if (NULL != tz) { if (!tzflag) { _tzset(); tzflag++; @@ -30,4 +32,5 @@ int gettimeofday(struct timeval *tv, struct timezone *tz) { return 0; } + #endif //STLINK_HAVE_SYS_TIME_H |