Clean up more code

- Found some bugs in LLVM compiler-rt library
- The useless LIBC_STUBS package is now deleted
- Improve the overflow checking story even further
- Get chibicc tests working in MODE=dbg mode again
- The libc/isystem/ headers now have correctly named guards
This commit is contained in:
Justine Tunney 2023-06-18 00:55:09 -07:00
parent afc58a8b41
commit d7c79f43ef
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
294 changed files with 912 additions and 1208 deletions

View file

@ -1,38 +1,34 @@
#ifndef COSMOPOLITAN_LIBC_TIME_TIME_H_
#define COSMOPOLITAN_LIBC_TIME_TIME_H_
#define TIME_UTC 1
#define CLOCKS_PER_SEC 1000000L
#define TIME_UTC 1
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
_Hide extern const char kWeekdayNameShort[7][4];
_Hide extern const char kWeekdayName[7][10];
_Hide extern const char kMonthNameShort[12][4];
_Hide extern const char kMonthName[12][10];
_Hide extern const unsigned short kMonthYearDay[2][12];
extern char *tzname[2];
extern long timezone;
extern int daylight;
char *ctime(const int64_t *);
char *ctime_r(const int64_t *, char[hasatleast 26]);
double difftime(int64_t, int64_t)
dontthrow pureconst;
extern long double (*nowl)(void);
int64_t clock(void);
double difftime(int64_t, int64_t) pureconst;
int64_t posix2time(int64_t) pureconst;
int64_t time(int64_t *);
int64_t time2posix(int64_t) pureconst;
void tzset(void);
#ifdef COSMO
_Hide extern const char kWeekdayNameShort[7][4];
_Hide extern const char kWeekdayName[7][10];
_Hide extern const char kMonthNameShort[12][4];
_Hide extern const char kMonthName[12][10];
_Hide extern const unsigned short kMonthYearDay[2][12];
extern long double (*nowl)(void);
long double ConvertTicksToNanos(double);
long double dsleep(long double);
long double dtime(int);
unsigned alarm(unsigned);
unsigned sleep(unsigned);
void RefreshTime(void);
void tzset(void);
#endif
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

View file

@ -34,13 +34,10 @@ LIBC_TIME_A_DIRECTDEPS = \
LIBC_MEM \
LIBC_NEXGEN32E \
LIBC_NT_KERNEL32 \
LIBC_NT_NTDLL \
LIBC_RUNTIME \
LIBC_STDIO \
LIBC_STR \
LIBC_STUBS \
LIBC_SYSV \
LIBC_SYSV_CALLS \
LIBC_ZIPOS \
THIRD_PARTY_COMPILER_RT

View file

@ -20,8 +20,8 @@
#include "libc/calls/struct/timeval.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/mem/fmt.h"
#include "libc/mem/mem.h"
#include "libc/stdio/stdio.h"
#include "libc/sysv/consts/clock.h"
#include "libc/time/struct/tm.h"
#include "libc/time/time.h"
@ -56,7 +56,7 @@ static char *xiso8601_impl(struct timespec *opt_ts, int sswidth) {
localtime_r(&sec, &tm);
strftime(timebuf, sizeof(timebuf), "%Y-%m-%dT%H:%M:%S", &tm);
strftime(zonebuf, sizeof(zonebuf), "%z", &tm);
(asprintf)(&p, "%s.%0*ld%s", timebuf, sswidth, subsec, zonebuf);
asprintf(&p, "%s.%0*ld%s", timebuf, sswidth, subsec, zonebuf);
return p;
}