From: cuz Date: Thu, 12 Jun 2003 18:17:46 +0000 (+0000) Subject: sleep.c doesn't compile on platforms without a clock function X-Git-Tag: V2.12.0~1500 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a8534fbb7c23d22610745c34f49643b2a4ed5105;p=cc65 sleep.c doesn't compile on platforms without a clock function git-svn-id: svn://svn.cc65.org/cc65/trunk@2218 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/common/sleep.c b/libsrc/common/sleep.c index a8fc4b32e..3a8e8e2e0 100644 --- a/libsrc/common/sleep.c +++ b/libsrc/common/sleep.c @@ -8,17 +8,20 @@ -#include +#include #include +/* We cannot implement this function without a working clock function */ +#if defined(CLOCKS_PER_SEC) unsigned __fastcall__ sleep (unsigned wait) { clock_t goal = clock () + ((clock_t) wait) * CLOCKS_PER_SEC; while ((long) (goal - clock ()) > 0) ; return 0; } +#endif