diff options
author | Jason Evans <jasone@canonware.com> | 2016-02-21 07:45:22 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2016-02-21 07:45:22 (GMT) |
commit | fd9cd7a6cc575cab43e22f989c6709ffe0da451f (patch) | |
tree | 56e9d41fe2f95bb8dc0d94a3bea70f1f8bc332e1 | |
parent | 56139dc4035abc76744ad24844daaba77a721640 (diff) | |
download | jemalloc-fd9cd7a6cc575cab43e22f989c6709ffe0da451f.zip jemalloc-fd9cd7a6cc575cab43e22f989c6709ffe0da451f.tar.gz jemalloc-fd9cd7a6cc575cab43e22f989c6709ffe0da451f.tar.bz2 |
Fix time_update() to compile and work on MinGW.
-rw-r--r-- | src/time.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -161,12 +161,15 @@ time_update(struct timespec *time) time_copy(&old_time, time); #ifdef _WIN32 - FILETIME ft; - uint64_t ticks; - GetSystemTimeAsFileTime(&ft); - ticks = (ft.dwHighDateTime << 32) | ft.dWLowDateTime; - time->tv_sec = ticks / 10000; - time->tv_nsec = ((ticks % 10000) * 100); + { + FILETIME ft; + uint64_t ticks; + GetSystemTimeAsFileTime(&ft); + ticks = (((uint64_t)ft.dwHighDateTime) << 32) | + ft.dwLowDateTime; + time->tv_sec = ticks / 10000000; + time->tv_nsec = ((ticks % 10000000) * 100); + } #elif JEMALLOC_CLOCK_GETTIME if (sysconf(_SC_MONOTONIC_CLOCK) > 0) clock_gettime(CLOCK_MONOTONIC, time); |