mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 00:08:30 +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_ALG_ALG_H_
|
||||
#define COSMOPOLITAN_LIBC_ALG_ALG_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
void *bsearch(const void *, const void *, size_t, size_t,
|
||||
|
@ -33,5 +32,4 @@ int radix_sort_int32(int32_t *, size_t);
|
|||
int radix_sort_int64(int64_t *, size_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_ALG_ALG_H_ */
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ALG_ARRAYLIST_H_
|
||||
#define COSMOPOLITAN_LIBC_ALG_ARRAYLIST_H_
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/mem/internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
/* TODO(jart): DELETE */
|
||||
|
||||
|
@ -27,5 +25,4 @@
|
|||
})
|
||||
#endif /* concat */
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_ALG_ARRAYLIST_H_ */
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define COSMOPOLITAN_LIBC_ALG_ARRAYLIST2_H_
|
||||
#include "libc/mem/internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/* TODO(jart): Fully develop these better macros. */
|
||||
|
@ -35,5 +34,4 @@ COSMOPOLITAN_C_START_
|
|||
#endif /* CONCAT */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_ALG_ARRAYLIST2_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ALG_BISECT_H_
|
||||
#define COSMOPOLITAN_LIBC_ALG_BISECT_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
forceinline void *bisect(const void *k, const void *data, size_t n, size_t size,
|
||||
|
@ -29,5 +28,4 @@ forceinline void *bisect(const void *k, const void *data, size_t n, size_t size,
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_ALG_BISECT_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ALG_CRITBIT0_H_
|
||||
#define COSMOPOLITAN_LIBC_ALG_CRITBIT0_H_
|
||||
#include "libc/stdbool.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § data structures » critical bit tree (for c strings) ─╬─│┼
|
||||
|
@ -24,5 +23,4 @@ intptr_t critbit0_allprefixed(struct critbit0 *, const char *,
|
|||
int critbit0_emplace(struct critbit0 *, const void *, size_t) paramsnonnull();
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_ALG_CRITBIT0_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_MEM_GC_H_
|
||||
#define COSMOPOLITAN_LIBC_MEM_GC_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
void *_gc(void *);
|
||||
|
@ -23,5 +22,4 @@ void _gc_free(void *);
|
|||
#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_MEM_GC_H_ */
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_MEM_GC_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_MEM_GC_INTERNAL_H_
|
||||
#include "libc/mem/gc.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
#define gc(THING) _gc(THING)
|
||||
#define defer(FN, ARG) _defer(FN, ARG)
|
||||
#define gclongjmp(JB, ARG) _gclongjmp(JB, ARG)
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_MEM_GC_INTERNAL_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_MEM_HOOK_H_
|
||||
#define COSMOPOLITAN_LIBC_MEM_HOOK_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern void (*hook_free)(void *);
|
||||
|
@ -14,5 +13,4 @@ extern size_t (*hook_malloc_usable_size)(void *);
|
|||
extern size_t (*hook_bulk_free)(void *[], size_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_MEM_HOOK_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_MEM_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_MEM_INTERNAL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct CritbitNode {
|
||||
|
@ -13,5 +12,4 @@ int __putenv(char *, bool);
|
|||
bool __grow(void *, size_t *, size_t, size_t) paramsnonnull((1, 2)) libcesque;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_MEM_INTERNAL_H_ */
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#define M_GRANULARITY (-2)
|
||||
#define M_MMAP_THRESHOLD (-3)
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § dynamic memory ─╬─│┼
|
||||
|
@ -58,5 +57,4 @@ size_t malloc_set_footprint_limit(size_t);
|
|||
void malloc_inspect_all(void (*)(void *, void *, size_t, void *), void *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_MEM_MEM_H_ */
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "libc/assert.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/log/backtrace.internal.h"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ALG_REVERSE_H_
|
||||
#define COSMOPOLITAN_LIBC_ALG_REVERSE_H_
|
||||
#include "libc/intrin/xchg.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
/**
|
||||
* Reverses array.
|
||||
|
@ -27,5 +26,4 @@
|
|||
Array; \
|
||||
})
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_ALG_REVERSE_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_RAND_SHUFFLE_H_
|
||||
#define COSMOPOLITAN_LIBC_RAND_SHUFFLE_H_
|
||||
#include "libc/intrin/xchg.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
/**
|
||||
* Fisher-Yates shuffle.
|
||||
|
@ -19,5 +18,4 @@
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_RAND_SHUFFLE_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_MEM_SORTEDINTS_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_MEM_SORTEDINTS_INTERNAL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct SortedInts {
|
||||
|
@ -15,5 +14,4 @@ int CountInt(const struct SortedInts *, int);
|
|||
int LeftmostInt(const struct SortedInts *, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_MEM_SORTEDINTS_INTERNAL_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue