From ca9eb81d0b8624bfee6dac7b062747b01e8aeb4b Mon Sep 17 00:00:00 2001 From: stijn Date: Sun, 25 Oct 2015 12:40:24 +0100 Subject: 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. --- windows/init.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'windows/init.c') 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 #include -#include - -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(); } -- cgit v1.2.3