mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-30 01:02:29 +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
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_RUNTIME_CLKTCK_H_
|
||||
#define COSMOPOLITAN_LIBC_RUNTIME_CLKTCK_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define CLK_TCK (__clk_tck())
|
||||
|
@ -8,5 +7,4 @@ COSMOPOLITAN_C_START_
|
|||
int __clk_tck(void) pureconst;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_CLKTCK_H_ */
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "ape/relocations.h"
|
||||
#include "ape/sections.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/newbie.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/macros.internal.h"
|
||||
|
|
|
@ -65,7 +65,6 @@ typedef double fenv_t;
|
|||
#define FLT_EVAL_METHOD 0
|
||||
#endif
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define FLT_ROUNDS (__flt_rounds())
|
||||
|
@ -85,5 +84,4 @@ int __flt_rounds(void);
|
|||
int __fesetround(int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_FENV_H_ */
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/str/utf16.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/promises.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/dce.h"
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#define RUNLEVEL_MALLOC 1
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern int __pid;
|
||||
|
@ -50,6 +49,5 @@ void __on_arithmetic_overflow(void);
|
|||
void __init_fds(int, char **, char **);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* ANSI */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_INTERNAL_H_ */
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "libc/runtime/stack.h"
|
||||
#include "libc/sysv/consts/ss.h"
|
||||
#include "libc/thread/tls.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define kAutomapStart 0x100080040000
|
||||
|
@ -188,5 +187,4 @@ forceinline pureconst bool OverlapsShadowSpace(const void *p, size_t n) {
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_MEMTRACK_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_RUNTIME_METALPRINTF_H_
|
||||
#define COSMOPOLITAN_LIBC_RUNTIME_METALPRINTF_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
void MetalPrintf(const char *, ...);
|
||||
|
@ -12,5 +11,4 @@ void MetalPrintf(const char *, ...);
|
|||
} while (0)
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_METALPRINTF_H_ */
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_RUNTIME_MMAN_H_
|
||||
#define COSMOPOLITAN_LIBC_RUNTIME_MMAN_H_
|
||||
#include "libc/runtime/e820.internal.h"
|
||||
|
||||
/* Values for mman::pc_video_type. */
|
||||
#define PC_VIDEO_TEXT 0
|
||||
#define PC_VIDEO_BGR565 1
|
||||
#define PC_VIDEO_BGR555 2
|
||||
#define PC_VIDEO_BGRX8888 3
|
||||
#define PC_VIDEO_RGBX8888 4
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -39,22 +47,14 @@ struct mman {
|
|||
struct { /* 0x1d48 — starting cursor pos. */
|
||||
unsigned short y, x;
|
||||
} pc_video_curs_info;
|
||||
unsigned short pc_video_char_height; /* 0x1d4c — character height (useful
|
||||
for setting cursor shape
|
||||
in text mode) */
|
||||
uint64_t pc_acpi_rsdp; /* 0x1d50 — pointer to ACPI RSDP;
|
||||
NULL means to search for
|
||||
it in legacy BIOS areas */
|
||||
unsigned short pc_video_char_height; /* 0x1d4c — character height (useful
|
||||
for setting cursor shape
|
||||
in text mode) */
|
||||
uint64_t pc_acpi_rsdp; /* 0x1d50 — pointer to ACPI RSDP;
|
||||
NULL means to search for
|
||||
it in legacy BIOS areas */
|
||||
};
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
||||
/* Values for mman::pc_video_type. */
|
||||
#define PC_VIDEO_TEXT 0
|
||||
#define PC_VIDEO_BGR565 1
|
||||
#define PC_VIDEO_BGR555 2
|
||||
#define PC_VIDEO_BGRX8888 3
|
||||
#define PC_VIDEO_RGBX8888 4
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_MMAN_H_ */
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/asancodes.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/bsr.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/directmap.internal.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "ape/sections.internal.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/thread/tls.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/elf/tinyelf.internal.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/log/libfatal.internal.h"
|
||||
|
|
|
@ -23,12 +23,10 @@
|
|||
#define _PC_SYMLINK_MAX 19
|
||||
#define _PC_2_SYMLINKS 20
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
long fpathconf(int, int);
|
||||
long pathconf(const char *, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_PATHCONF_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_RUNTIME_RUNTIME_H_
|
||||
#define COSMOPOLITAN_LIBC_RUNTIME_RUNTIME_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § runtime ─╬─│┼
|
||||
|
@ -148,5 +147,4 @@ __funline int __trace_disabled(int x) {
|
|||
#endif /* _COSMO_SOURCE */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_RUNTIME_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_RUNTIME_STACK_H_
|
||||
#define COSMOPOLITAN_LIBC_RUNTIME_STACK_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
#ifdef _COSMO_SOURCE
|
||||
|
||||
/**
|
||||
|
@ -158,5 +157,4 @@ int FreeCosmoStack(void *) libcesque;
|
|||
COSMOPOLITAN_C_END_
|
||||
#endif /* GNU ELF */
|
||||
#endif /* _COSMO_SOURCE */
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_STACK_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYMBOLS_H_
|
||||
#define COSMOPOLITAN_LIBC_SYMBOLS_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define SYMBOLS_MAGIC 0x544d5953 /* SYMT */
|
||||
|
@ -36,5 +35,4 @@ int __get_symbol(struct SymbolTable *, intptr_t);
|
|||
char *__get_symbol_name(struct SymbolTable *, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SYMBOLS_H_ */
|
||||
|
|
|
@ -145,11 +145,9 @@
|
|||
#define _SC_SIGSTKSZ 249
|
||||
#define _SC_MINSIGSTKSZ 250
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
long sysconf(int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_SYSCONF_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_RUNTIME_SYSLIB_H_
|
||||
#define COSMOPOLITAN_LIBC_RUNTIME_SYSLIB_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/**
|
||||
|
@ -80,5 +79,4 @@ struct Syslib {
|
|||
extern struct Syslib *__syslib;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_SYSLIB_H_ */
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#define UNW_TDEP_CURSOR_LEN 127
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
typedef enum {
|
||||
|
@ -38,5 +37,4 @@ _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *);
|
|||
void *_Unwind_FindEnclosingFunction(void *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_UNWIND_H_ */
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#define UT_HOSTSIZE 256
|
||||
#define UT_LINESIZE 32
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct lastlog {
|
||||
|
@ -43,5 +42,4 @@ void updwtmp(const char *, const struct utmp *);
|
|||
#define WTMP_FILENAME _PATH_WTMP
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_UTMP_H_ */
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define COSMOPOLITAN_LIBC_RUNTIME_UTMPX_H_
|
||||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct utmpx {
|
||||
|
@ -47,5 +46,4 @@ int utmpxname(const char *);
|
|||
#define DEAD_PROCESS 8
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_UTMPX_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_RUNTIME_WINARGS_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_RUNTIME_WINARGS_INTERNAL_H_
|
||||
#include "libc/limits.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct WinArgs {
|
||||
|
@ -14,5 +13,4 @@ struct WinArgs {
|
|||
} forcealign(16);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RUNTIME_WINARGS_INTERNAL_H_ */
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "libc/assert.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/syscall_support-nt.internal.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/nomultics.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/limits.h"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "libc/mem/alg.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/auxv.h"
|
||||
#include "libc/sysv/consts/f.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/memtrack.internal.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/f.h"
|
||||
#include "libc/sysv/consts/fd.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include "libc/assert.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/runtime/zipos.internal.h"
|
||||
#include "libc/stdio/sysparam.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/thread/tls.h"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ZIPOS_ZIPOS_H_
|
||||
#define COSMOPOLITAN_LIBC_ZIPOS_ZIPOS_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define ZIPOS_PATH_MAX 1024
|
||||
|
@ -59,5 +58,4 @@ void *__zipos_mmap(void *, uint64_t, int32_t, int32_t, struct ZiposHandle *,
|
|||
int64_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_ZIPOS_ZIPOS_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue