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,11 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_FMT_BING_H_
#define COSMOPOLITAN_LIBC_FMT_BING_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
int bing(int, int) nosideeffect;
int unbing(int) nosideeffect;
void *unbingbuf(void *, size_t, const char16_t *, int);
void *unbingstr(const char16_t *) paramsnonnull() mallocesque;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_FMT_BING_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_FMT_CONV_H_
#define COSMOPOLITAN_LIBC_FMT_CONV_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
int abs(int) libcesque pureconst;
@ -73,5 +72,4 @@ imaxdiv_t imaxdiv(intmax_t, intmax_t) pureconst;
#endif
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_FMT_CONV_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_FMT_DIVMOD10_H_
#define COSMOPOLITAN_LIBC_FMT_DIVMOD10_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
forceinline uint64_t __divmod10(uint64_t __x, unsigned *__r) {
#if defined(__STRICT_ANSI__) || !defined(__GNUC__) || \
@ -22,5 +21,4 @@ forceinline uint64_t __divmod10(uint64_t __x, unsigned *__r) {
#endif
}
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_FMT_DIVMOD10_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_FMT_ITOA_H_
#define COSMOPOLITAN_LIBC_FMT_ITOA_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
#ifdef _COSMO_SOURCE
COSMOPOLITAN_C_START_
@ -44,5 +43,4 @@ size_t uint64toarray_radix8(uint64_t, char[hasatleast 24]);
COSMOPOLITAN_C_END_
#endif /* _COSMO_SOURCE */
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_FMT_ITOA_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_FMT_LEB128_H_
#define COSMOPOLITAN_LIBC_FMT_LEB128_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
#ifdef _COSMO_SOURCE
COSMOPOLITAN_C_START_
@ -18,5 +17,4 @@ int unuleb64(const char *, size_t, uint64_t *);
COSMOPOLITAN_C_END_
#endif /* _COSMO_SOURCE */
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_FMT_LEB128_H_ */

View file

@ -1,11 +1,9 @@
#ifndef COSMOPOLITAN_LIBC_FMT_LIBGEN_H_
#define COSMOPOLITAN_LIBC_FMT_LIBGEN_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
char *dirname(char *);
char *basename(char *);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_FMT_LIBGEN_H_ */

View file

@ -7,7 +7,6 @@
#define MODERNITYSECONDS 11644473600ull
#define HECTONANOSECONDS 10000000ull
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
int64_t DosDateTimeToUnix(uint32_t, uint32_t) pureconst;
@ -37,5 +36,4 @@ struct timeval WindowsTimeToTimeVal(int64_t) pureconst;
#define TimeValToFileTime(x) MakeFileTime(TimeValToWindowsTime(x))
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_FMT_WINTIME_H_ */