]> git.sur5r.net Git - cc65/commitdiff
sleep.c doesn't compile on platforms without a clock function
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 12 Jun 2003 18:17:46 +0000 (18:17 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 12 Jun 2003 18:17:46 +0000 (18:17 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2218 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/common/sleep.c

index a8fc4b32e401dbb8076d15998dea86302ca68f50..3a8e8e2e0e9d4546b74d63e622890888751308e7 100644 (file)
@@ -8,17 +8,20 @@
 
 
 
-#include <time.h>     
+#include <time.h>
 #include <unistd.h>
 
 
 
+/* 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