Fix compat_usleep for WIN32

When compiled with VS2017, the negative applied to the uint wait
time is ignored. Fixed by casting first.
This commit is contained in:
Andrew Whittle
2017-12-09 10:13:52 -07:00
parent 31a0784160
commit 01d6723d5b
@@ -19,7 +19,7 @@ extern "C" void compat_usleep(uint64_t waitTime)
HANDLE timer;
LARGE_INTEGER ft;
ft.QuadPart = -(10*waitTime); // Convert to 100 nanosecond interval, negative value indicates relative time
ft.QuadPart = -10*(LONGLONG)waitTime; // Convert to 100 nanosecond interval, negative value indicates relative time
timer = CreateWaitableTimer(NULL, TRUE, NULL);
SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0);