mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-10-21 06:18:34 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user