Reduce header complexity

- Remove most __ASSEMBLER__ __LINKER__ ifdefs
- Rename libc/intrin/bits.h to libc/serialize.h
- Block pthread cancelation in fchmodat() polyfill
- Remove `clang-format off` statements in third_party
This commit is contained in:
Justine Tunney 2023-11-28 14:24:28 -08:00
parent 96f979dfc5
commit fa20edc44d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3057 changed files with 410 additions and 4398 deletions

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_TIME_CLOCKSTONANOS_INTERNAL_H_
#define COSMOPOLITAN_LIBC_TIME_CLOCKSTONANOS_INTERNAL_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
static inline uint64_t ClocksToNanos(uint64_t x, uint64_t y) {
@ -11,5 +10,4 @@ static inline uint64_t ClocksToNanos(uint64_t x, uint64_t y) {
}
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_TIME_CLOCKSTONANOS_INTERNAL_H_ */

View file

@ -5,7 +5,7 @@
#include "libc/calls/blockcancel.internal.h"
#include "libc/calls/calls.h"
#include "libc/cxxabi.h"
#include "libc/intrin/bits.h"
#include "libc/serialize.h"
#include "libc/mem/gc.h"
#include "libc/mem/mem.h"
#include "libc/str/str.h"

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_TIME_STRUCT_TIMEZONE_H_
#define COSMOPOLITAN_LIBC_TIME_STRUCT_TIMEZONE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct timezone {
@ -9,5 +8,4 @@ struct timezone {
};
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_TIME_STRUCT_TIMEZONE_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_TIME_STRUCT_TM_H_
#define COSMOPOLITAN_LIBC_TIME_STRUCT_TM_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct tm {
@ -40,5 +39,4 @@ char *iso8601us(char[hasatleast 27], struct tm *, long);
#endif /* _COSMO_SOURCE */
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_TIME_STRUCT_TM_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_TIME_STRUCT_UTIMBUF_H_
#define COSMOPOLITAN_LIBC_TIME_STRUCT_UTIMBUF_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct utimbuf {
@ -11,5 +10,4 @@ struct utimbuf {
int utime(const char *, const struct utimbuf *);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_TIME_STRUCT_UTIMBUF_H_ */

View file

@ -1,11 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_TIME_STRUCT_UTIMBUF_INTERNAL_H_
#define COSMOPOLITAN_LIBC_TIME_STRUCT_UTIMBUF_INTERNAL_H_
#include "libc/time/struct/utimbuf.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
int sys_utime(const char *, const struct utimbuf *);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_TIME_STRUCT_UTIMBUF_INTERNAL_H_ */

View file

@ -3,7 +3,6 @@
#define TIME_UTC 1
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern char *tzname[2];
@ -28,5 +27,4 @@ void RefreshTime(void);
#endif /* _COSMO_SOURCE */
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_TIME_TIME_H_ */

View file

@ -8,7 +8,6 @@
#include "libc/macros.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/ok.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
/* clang-format off */
@ -539,5 +538,4 @@ char *ctime_r(int64_t const *, char *);
#define isleap_sum(a, b) isleap((a) % 400 + (b) % 400)
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_TZ_PRIVATE_H_ */