ladybird/Ports/c-ray/patches/fix-usleep.patch

28 lines
620 B
Diff
Raw Normal View History

2020-02-25 20:03:47 +00:00
diff --git a/src/utils/timer.c b/src/utils/timer.c
index 9978a99..c94d33d 100644
--- a/src/utils/timer.c
+++ b/src/utils/timer.c
@@ -48,20 +48,13 @@ long getUs(struct timeval timer) {
return ((tmr2.tv_sec - timer.tv_sec) * 1000000) + (tmr2.tv_usec - timer.tv_usec);
}
+#include <unistd.h>
+
/**
Sleep for a given amount of milliseconds
@param ms Milliseconds to sleep for
*/
void sleepMSec(int ms) {
-#ifdef WINDOWS
- Sleep(ms);
-#elif __APPLE__
- struct timespec ts;
- ts.tv_sec = ms / 1000;
- ts.tv_nsec = (ms % 1000) * 1000000;
- nanosleep(&ts, NULL);
-#elif __linux__
usleep(ms * 1000);
-#endif
}