mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Make improvements
- More timspec_*() and timeval_*() APIs have been introduced. - The copyfd() function is now simplified thanks to POSIX rules. - More Cosmo-specific APIs have been moved behind the COSMO define. - The setitimer() polyfill for Windows NT is now much higher quality. - Fixed build error for MODE=aarch64 due to -mstringop-strategy=loop. - This change introduces `make MODE=nox87 toolchain` which makes it possible to build programs using your cosmocc toolchain that don't have legacy fpu instructions. This is useful, for example, if you want to have a ~22kb tinier blink virtual machine.
This commit is contained in:
parent
8dc11afcf6
commit
c3440d040c
132 changed files with 539 additions and 587 deletions
|
@ -19,13 +19,23 @@ int utimes(const char *, const struct timeval[2]);
|
|||
#ifdef COSMO
|
||||
/* cosmopolitan libc's non-posix timevals library
|
||||
removed by default due to emacs codebase clash */
|
||||
#define timeval_zero ((struct timeval){0})
|
||||
#define timeval_max ((struct timeval){0x7fffffffffffffff, 999999})
|
||||
int timeval_cmp(struct timeval, struct timeval) pureconst;
|
||||
struct timeval timeval_real(void);
|
||||
struct timeval timeval_frommicros(int64_t) pureconst;
|
||||
struct timeval timeval_frommillis(int64_t) pureconst;
|
||||
struct timeval timeval_add(struct timeval, struct timeval) pureconst;
|
||||
struct timeval timeval_sub(struct timeval, struct timeval) pureconst;
|
||||
struct timeval timeval_subz(struct timeval, struct timeval) pureconst;
|
||||
struct timeval timespec_totimeval(struct timespec) pureconst;
|
||||
struct timespec timeval_totimespec(struct timeval) pureconst;
|
||||
static inline bool timeval_iszero(struct timeval __tv) {
|
||||
return !(__tv.tv_sec | __tv.tv_usec);
|
||||
}
|
||||
static inline bool timeval_isvalid(struct timeval __tv) {
|
||||
return __tv.tv_sec >= 0 && __tv.tv_usec < 1000000ull;
|
||||
}
|
||||
#endif /* COSMO */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue