| ... | @@ -70,8 +70,7 @@ typedef SSIZE_T ssize_t; | ... | @@ -70,8 +70,7 @@ typedef SSIZE_T ssize_t; |
| 70 | #endif | 70 | #endif |
| 71 | | 71 | |
| 72 | #if defined(ZIG_OS_WINDOWS) | 72 | #if defined(ZIG_OS_WINDOWS) |
| 73 | static double win32_time_resolution; | 73 | static uint64_t windows_perf_freq; |
| 74 | static LARGE_INTEGER windows_perf_freq; | | |
| 75 | #elif defined(__MACH__) | 74 | #elif defined(__MACH__) |
| 76 | static clock_serv_t macos_calendar_clock; | 75 | static clock_serv_t macos_calendar_clock; |
| 77 | static clock_serv_t macos_monotonic_clock; | 76 | static clock_serv_t macos_monotonic_clock; |
| ... | @@ -1269,8 +1268,8 @@ OsTimeStamp os_timestamp_calendar(void) { | ... | @@ -1269,8 +1268,8 @@ OsTimeStamp os_timestamp_calendar(void) { |
| 1269 | OsTimeStamp os_timestamp_monotonic(void) { | 1268 | OsTimeStamp os_timestamp_monotonic(void) { |
| 1270 | OsTimeStamp result; | 1269 | OsTimeStamp result; |
| 1271 | #if defined(ZIG_OS_WINDOWS) | 1270 | #if defined(ZIG_OS_WINDOWS) |
| 1272 | LARGE_INTEGER counts; | 1271 | uint64_t counts; |
| 1273 | QueryPerformanceCounter(&counts); | 1272 | QueryPerformanceCounter((LARGE_INTEGER*)&counts); |
| 1274 | result.sec = counts / windows_perf_freq; | 1273 | result.sec = counts / windows_perf_freq; |
| 1275 | result.nsec = (counts % windows_perf_freq) * 1000000000u / windows_perf_freq; | 1274 | result.nsec = (counts % windows_perf_freq) * 1000000000u / windows_perf_freq; |
| 1276 | #elif defined(__MACH__) | 1275 | #elif defined(__MACH__) |
| ... | @@ -1386,9 +1385,7 @@ int os_init(void) { | ... | @@ -1386,9 +1385,7 @@ int os_init(void) { |
| 1386 | #if defined(ZIG_OS_WINDOWS) | 1385 | #if defined(ZIG_OS_WINDOWS) |
| 1387 | _setmode(fileno(stdout), _O_BINARY); | 1386 | _setmode(fileno(stdout), _O_BINARY); |
| 1388 | _setmode(fileno(stderr), _O_BINARY); | 1387 | _setmode(fileno(stderr), _O_BINARY); |
| 1389 | if (QueryPerformanceFrequency(&windows_perf_freq)) { | 1388 | if (!QueryPerformanceFrequency((LARGE_INTEGER*)&windows_perf_freq)) { |
| 1390 | win32_time_resolution = 1.0 / (double) windows_perf_freq; | | |
| 1391 | } else { | | |
| 1392 | return ErrorSystemResources; | 1389 | return ErrorSystemResources; |
| 1393 | } | 1390 | } |
| 1394 | #elif defined(__MACH__) | 1391 | #elif defined(__MACH__) |