mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
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:
parent
96f979dfc5
commit
fa20edc44d
3057 changed files with 410 additions and 4398 deletions
|
@ -14,7 +14,6 @@
|
|||
#define kappendf __kappendf
|
||||
#define kvappendf __kvappendf
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct appendz {
|
||||
|
@ -33,6 +32,5 @@ ssize_t kappendf(char **, const char *, ...);
|
|||
ssize_t kvappendf(char **, const char *, va_list);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* _COSMO_SOURCE */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_APPEND_H_ */
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/bsr.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_CALLS_DPRINTF_H_
|
||||
#define COSMOPOLITAN_LIBC_CALLS_DPRINTF_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int dprintf(int, const char *, ...) paramsnonnull((2));
|
||||
int vdprintf(int, const char *, va_list) paramsnonnull();
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_CALLS_DPRINTF_H_ */
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/thread/tls.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct StdioFlushHandles {
|
||||
|
@ -23,5 +22,4 @@ void __fflush_lock(void);
|
|||
void __fflush_unlock(void);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_FFLUSH_H_ */
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/cxxabi.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/pushpop.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/arraylist.internal.h"
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/divmod10.internal.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/bsr.h"
|
||||
#include "libc/intrin/nomultics.internal.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MUSL_FTW_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MUSL_FTW_H_
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/**
|
||||
|
@ -86,5 +85,4 @@ int nftw(const char *,
|
|||
int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MUSL_FTW_H_ */
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_STDIO_HEX_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_STDIO_HEX_INTERNAL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
char *DumpHex(const char *, size_t, size_t *);
|
||||
char *DumpHexc(const char *, size_t, size_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_HEX_INTERNAL_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_STDIO_ICONV_H_
|
||||
#define COSMOPOLITAN_LIBC_STDIO_ICONV_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
typedef void *iconv_t;
|
||||
|
@ -10,5 +9,4 @@ size_t iconv(iconv_t, char **, size_t *, char **, size_t *);
|
|||
int iconv_close(iconv_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_ICONV_H_ */
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#define PUSHBACK 12
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct FILE {
|
||||
|
@ -37,5 +36,4 @@ FILE *__stdio_alloc(void);
|
|||
void __stdio_free(FILE *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_INTERNAL_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_LCG_H_
|
||||
#define COSMOPOLITAN_LIBC_LCG_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
#ifdef _COSMO_SOURCE
|
||||
|
||||
forceinline uint64_t KnuthLinearCongruentialGenerator(uint64_t prev[1]) {
|
||||
|
@ -12,5 +11,4 @@ forceinline uint64_t KnuthLinearCongruentialGenerator(uint64_t prev[1]) {
|
|||
}
|
||||
|
||||
#endif /* _COSMO_SOURCE */
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_LCG_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_RAND_RAND_H_
|
||||
#define COSMOPOLITAN_LIBC_RAND_RAND_H_
|
||||
#define RAND_MAX __INT_MAX__
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § random ─╬─│┼
|
||||
|
@ -46,5 +45,4 @@ void rt_end(double *, double *, double *, double *, double *);
|
|||
#endif /* _COSMO_SOURCE */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RAND_RAND_H_ */
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#define TMP_MAX 10000
|
||||
#define BUFSIZ 4096
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
|
@ -181,5 +180,4 @@ int vfprintf_unlocked(FILE *, const char *, va_list)
|
|||
paramsnonnull() dontthrow nocallback;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_H_ */
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#define FSETLOCKING_INTERNAL 1
|
||||
#define FSETLOCKING_BYCALLER 2
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
size_t __fbufsize(FILE *);
|
||||
|
@ -25,5 +24,4 @@ size_t __freadahead(FILE *);
|
|||
void __freadptrinc(FILE *, size_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_STDIO_EXT_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_STDIO_STRLIST_H_
|
||||
#define COSMOPOLITAN_LIBC_STDIO_STRLIST_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct StrList {
|
||||
|
@ -14,5 +13,4 @@ void SortStrList(struct StrList *);
|
|||
int JoinStrList(struct StrList *, char **, uint64_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_STRLIST_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_STDIO_SYSCALL_H_
|
||||
#define COSMOPOLITAN_LIBC_STDIO_SYSCALL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define SYS_gettid 186
|
||||
|
@ -9,5 +8,4 @@ COSMOPOLITAN_C_START_
|
|||
long syscall(long, ...);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STDIO_SYSCALL_H_ */
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#define DEV_BSIZE 512
|
||||
#define NOGROUP (-1)
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define __bitop(x, i, o) ((x)[(i) / 8] o(1 << (i) % 8))
|
||||
|
@ -38,5 +37,4 @@ COSMOPOLITAN_C_START_
|
|||
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSPARAM_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue