From 67db15478139e00fd8426bfa7069b6c0538c4789 Mon Sep 17 00:00:00 2001 From: brarcher Date: Wed, 25 Dec 2013 03:04:04 +0000 Subject: [PATCH] sleep.c: use Sleep() if MSVC git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@931 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- lib/sleep.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/sleep.c b/lib/sleep.c index a70ffbd..1e2dfde 100644 --- a/lib/sleep.c +++ b/lib/sleep.c @@ -1,8 +1,16 @@ #include "libcompat.h" -unsigned int -sleep (unsigned int seconds CK_ATTRIBUTE_UNUSED) +#if _MSC_VER +#include /* Sleep() */ +#endif + +unsigned int sleep (unsigned int seconds CK_ATTRIBUTE_UNUSED) { - assert (0); - return 0; +#if _MSC_VER + DWORD millisecs = seconds * 1000; + Sleep(millisecs); +#else + assert (0); +#endif + return 0; } -- 2.40.0