mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 19:28: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_TOOL_PLINKO_LIB_CHAR_H_
|
||||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_CHAR_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
static inline pureconst bool IsC0(int c) {
|
||||
|
@ -39,5 +38,4 @@ int GetMonospaceCharacterWidth(int) pureconst;
|
|||
bool IsWide(int) pureconst;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_CHAR_H_ */
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
// not so large that we're drowning in virtual memory pages!
|
||||
#define TERM 0x20000
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#if IsModeDbg()
|
||||
|
@ -34,5 +33,4 @@ COSMOPOLITAN_C_START_
|
|||
#define DWBITS (sizeof(dword) * CHAR_BIT)
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_CONFIG_H_ */
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "tool/plinko/lib/error.h"
|
||||
#include "tool/plinko/lib/plinko.h"
|
||||
#include "tool/plinko/lib/types.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
forceinline void Set(int i, dword t) {
|
||||
|
@ -64,5 +63,4 @@ int ShareCons(int, int);
|
|||
int ShareList(int, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_CONS_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_ERROR_H_
|
||||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_ERROR_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
void Raise(int) relegated wontreturn;
|
||||
|
@ -10,5 +9,4 @@ void StackOverflow(void) relegated wontreturn;
|
|||
void React(int, int, int) relegated wontreturn;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_ERROR_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_GC_H_
|
||||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_GC_H_
|
||||
#include "tool/plinko/lib/types.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct Gc {
|
||||
|
@ -30,5 +29,4 @@ forceinline void Mark(struct Gc *G, int x) {
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_GC_H_ */
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_HISTO_H_
|
||||
#include "libc/intrin/bsr.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define HISTO(H, X) \
|
||||
|
@ -16,5 +15,4 @@ void PrintHistogram(int, const char *, const long *, size_t);
|
|||
long GetLongSum(const long *, size_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_HISTO_H_ */
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "tool/plinko/lib/error.h"
|
||||
#include "tool/plinko/lib/plinko.h"
|
||||
#include "tool/plinko/lib/stack.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
forceinline nosideeffect int Head(int x) {
|
||||
|
@ -131,5 +130,4 @@ static inline nosideeffect int Cddddr(int X) {
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_INDEX_H_ */
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_KTPENC_H_
|
||||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_KTPENC_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const short kTpEnc[25];
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_KTPENC_H_ */
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "libc/runtime/runtime.h"
|
||||
#include "tool/plinko/lib/config.h"
|
||||
#include "tool/plinko/lib/types.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define LO(x) (int)(x)
|
||||
|
@ -333,5 +332,4 @@ static inline int Keep(int x, int y) {
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_PLINKO_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_PRINT_H_
|
||||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_PRINT_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int Print(int, int);
|
||||
|
@ -27,5 +26,4 @@ void PrintNewline(int);
|
|||
void PrintTree(int, int, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_PRINT_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_PRINTF_H_
|
||||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_PRINTF_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int Printf(const char *, ...);
|
||||
|
@ -10,5 +9,4 @@ int Vfprintf(const char *, va_list, int);
|
|||
int Vfnprintf(const char *, va_list, int, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_PRINTF_H_ */
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "libc/stdckdint.h"
|
||||
#include "tool/plinko/lib/error.h"
|
||||
#include "tool/plinko/lib/plinko.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define SetFrame(r, x) \
|
||||
|
@ -45,5 +44,4 @@ forceinline void Repush(int x) {
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_STACK_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_TRACE_H_
|
||||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_TRACE_H_
|
||||
#include "libc/str/str.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define START_TRACE \
|
||||
|
@ -36,5 +35,4 @@ COSMOPOLITAN_C_START_
|
|||
void EnableTracing(void);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_TRACE_H_ */
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_TREE_H_
|
||||
#include "tool/plinko/lib/cons.h"
|
||||
#include "tool/plinko/lib/plinko.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int PutTree(int, int, int);
|
||||
|
@ -43,5 +42,4 @@ forceinline int Bkn(int N) {
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_TREE_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_TYPES_H_
|
||||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_TYPES_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
typedef unsigned long dword;
|
||||
|
@ -11,5 +10,4 @@ struct qword {
|
|||
};
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_TYPES_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue