mirror of
https://github.com/AltraMayor/f3.git
synced 2025-09-10 07:39:31 -04:00
On OpenBSD use the MacOS msleep(), not the default one
which uses clock_nanosleep(2) which OpenBSD doesn't have.
This commit is contained in:
parent
373504735e
commit
bca777bef4
8
utils.c
8
utils.c
@ -212,6 +212,10 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* Apple Macintosh */
|
||||||
|
|
||||||
|
#if (__APPLE__ && __MACH__) || defined(__OpenBSD__)
|
||||||
|
|
||||||
#include <unistd.h> /* For usleep(). */
|
#include <unistd.h> /* For usleep(). */
|
||||||
|
|
||||||
void msleep(double wait_ms)
|
void msleep(double wait_ms)
|
||||||
@ -219,7 +223,7 @@ void msleep(double wait_ms)
|
|||||||
assert(!usleep(wait_ms * 1000));
|
assert(!usleep(wait_ms * 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else /* Apple Macintosh / OpenBSD */
|
||||||
|
|
||||||
#include <time.h> /* For clock_gettime() and clock_nanosleep(). */
|
#include <time.h> /* For clock_gettime() and clock_nanosleep(). */
|
||||||
|
|
||||||
@ -254,4 +258,4 @@ void msleep(double wait_ms)
|
|||||||
assert(ret == 0);
|
assert(ret == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* Apple Macintosh / OpenBSD */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user