diff options
| author | stijn | 2015-10-25 12:40:24 +0100 |
|---|---|---|
| committer | Paul Sokolovsky | 2015-10-25 15:42:19 +0300 |
| commit | ca9eb81d0b8624bfee6dac7b062747b01e8aeb4b (patch) | |
| tree | aaacbb8e8f7ee19f6c3901344965f27e04e58a13 /windows/init.c | |
| parent | 1c55310bcced133fa4efc1546c0001f3ae4a9fc6 (diff) | |
windows: Add usleep() implementation for msvc port
Also make sleep.c self-contained by moving initialization code,
instead of having part of the code in init.c, and add a header file
to accomodate this.
msec_sleep() now uses the usleep() implementation as well.
Diffstat (limited to 'windows/init.c')
| -rw-r--r-- | windows/init.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/windows/init.c b/windows/init.c index a370c464e..743814d60 100644 --- a/windows/init.c +++ b/windows/init.c @@ -26,12 +26,10 @@ #include <stdlib.h> #include <stdio.h> -#include <windows.h> - -HANDLE hSleepEvent = NULL; +#include "sleep.h" void init() { - hSleepEvent = CreateEvent(NULL, TRUE, FALSE, FALSE); + init_sleep(); #ifdef __MINGW32__ putenv("PRINTF_EXPONENT_DIGITS=2"); #else @@ -40,7 +38,5 @@ void init() { } void deinit() { - if (hSleepEvent != NULL) { - CloseHandle(hSleepEvent); - } + deinit_sleep(); } |
