mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 22:27:44 +00:00
Ports: Update the C-ray renderer port
This commit is contained in:
parent
712e7102b0
commit
22259bf85d
9 changed files with 85 additions and 87 deletions
27
Ports/c-ray/patches/fix-usleep.patch
Normal file
27
Ports/c-ray/patches/fix-usleep.patch
Normal file
|
@ -0,0 +1,27 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue