mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-04 08:50:27 +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
|
@ -3,7 +3,6 @@
|
|||
#include "libc/tinymath/atan_data.internal.h"
|
||||
#include "libc/tinymath/estrin_wrap.internal.h"
|
||||
#include "libc/tinymath/horner.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
// clang-format off
|
||||
|
||||
|
@ -53,5 +52,4 @@ eval_poly (DBL_T z, DBL_T az, DBL_T shift)
|
|||
#undef P
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_ATAN_COMMON_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_ATAN_DATA_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_ATAN_DATA_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define ATAN_POLY_NCOEFFS 20
|
||||
|
@ -9,5 +8,4 @@ extern const struct atan_poly_data {
|
|||
} __atan_poly_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_ATAN_DATA_H_ */
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "libc/tinymath/atanf_data.internal.h"
|
||||
#include "libc/tinymath/estrin_wrap.internal.h"
|
||||
#include "libc/tinymath/hornerf.internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
// clang-format off
|
||||
|
||||
|
@ -42,5 +41,4 @@ eval_poly (FLT_T z, FLT_T az, FLT_T shift)
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_ATANF_COMMON_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_ATANF_DATA_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_ATANF_DATA_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define ATANF_POLY_NCOEFFS 8
|
||||
|
@ -9,5 +8,4 @@ extern const struct atanf_poly_data {
|
|||
} __atanf_poly_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_ATANF_DATA_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_COMPLEX_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_COMPLEX_INTERNAL_H_
|
||||
#include "libc/tinymath/internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define EXTRACT_WORDS(hi, lo, d) \
|
||||
|
@ -44,5 +43,4 @@ _Complex double __ldexp_cexp(_Complex double, int);
|
|||
_Complex float __ldexp_cexpf(_Complex float, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_COMPLEX_INTERNAL_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_EMOD_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_EMOD_H_
|
||||
#include "libc/math.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
/**
|
||||
* Returns Euclidean floating-point division remainder.
|
||||
|
@ -16,5 +15,4 @@
|
|||
__x - fabs(__y) * floor(__x / fabs(__y)); \
|
||||
})
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_EMOD_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_EMODL_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_EMODL_H_
|
||||
#include "libc/math.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
/**
|
||||
* Returns Euclidean floating-point division remainder.
|
||||
|
@ -16,5 +15,4 @@
|
|||
__x - fabsl(__y) * floorl(__x / fabsl(__y)); \
|
||||
})
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_EMODL_H_ */
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#define EXP2F_TABLE_BITS 5
|
||||
#define EXP2F_POLY_ORDER 3
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const struct exp2f_data {
|
||||
|
@ -17,5 +16,4 @@ extern const struct exp2f_data {
|
|||
} __exp2f_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_EXP2F_DATA_INTERNAL_H_ */
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#define EXP_USE_TOINT_NARROW 0
|
||||
#define EXP2_POLY_ORDER 5
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const struct exp_data {
|
||||
|
@ -21,5 +20,4 @@ extern const struct exp_data {
|
|||
} __exp_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_EXP_DATA_H_ */
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_EXPO_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_EXPO_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
double __expo2(double, double);
|
||||
float __expo2f(float, float);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_EXPO_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_FEVAL_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_FEVAL_INTERNAL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
static inline void fevalf(float x) {
|
||||
|
@ -19,5 +18,4 @@ static inline void fevall(long double x) {
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_FEVAL_INTERNAL_H_ */
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "libc/complex.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/runtime/fenv.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
// clang-format off
|
||||
|
||||
|
@ -1036,5 +1035,4 @@ __ldexp_cexpl(long double complex z, int expt)
|
|||
#endif /* _COMPLEX_H */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_FREEBSD_INTERNAL_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_HORNER_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_HORNER_INTERNAL_H_
|
||||
#include "libc/math.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#if WANT_VMATH
|
||||
|
@ -13,5 +12,4 @@ COSMOPOLITAN_C_START_
|
|||
#include "libc/tinymath/horner_wrap.internal.h"
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_HORNER_INTERNAL_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_HORNERF_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_HORNERF_INTERNAL_H_
|
||||
#include "libc/math.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#if WANT_VMATH
|
||||
|
@ -13,5 +12,4 @@ COSMOPOLITAN_C_START_
|
|||
#include "libc/tinymath/horner_wrap.internal.h"
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_HORNERF_INTERNAL_H_ */
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#define WANT_ROUNDING 1
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define issignalingf_inline(x) 0
|
||||
|
@ -82,5 +81,4 @@ long double __math_invalidl(long double);
|
|||
} while (0)
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_INTERNAL_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_INVTRIGL_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_INVTRIGL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/* shared by acosl, asinl and atan2l */
|
||||
|
@ -12,5 +11,4 @@ extern const long double pio2_hi, pio2_lo;
|
|||
long double __invtrigl_R(long double z);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_INVTRIGL_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_KERNEL_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_KERNEL_INTERNAL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
double __cos(double, double);
|
||||
|
@ -18,5 +17,4 @@ int __rem_pio2_large(double *, double *, int, int, int);
|
|||
int __rem_pio2f(float, double *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_KERNEL_INTERNAL_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_LDSHAPE_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_LDSHAPE_INTERNAL_H_
|
||||
#include "libc/math.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||
|
@ -61,5 +60,4 @@ union ldshape {
|
|||
#endif
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_LDSHAPE_INTERNAL_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_LOG1PF_DATA_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_LOG1PF_DATA_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define LOG1PF_2U5
|
||||
|
@ -11,5 +10,4 @@ extern const struct log1pf_data {
|
|||
} __log1pf_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_LOG1PF_DATA_H_ */
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#define LOG2_POLY_ORDER 7
|
||||
#define LOG2_POLY1_ORDER 11
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const struct log2_data {
|
||||
|
@ -24,5 +23,4 @@ extern const struct log2_data {
|
|||
} __log2_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_LOG2_DATA_INTERNAL_H_ */
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#define LOG2F_TABLE_BITS 4
|
||||
#define LOG2F_POLY_ORDER 4
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const struct log2f_data {
|
||||
|
@ -15,5 +14,4 @@ extern const struct log2f_data {
|
|||
} __log2f_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_LOG2F_DATA_INTERNAL_H_ */
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#define LOG_POLY_ORDER 6
|
||||
#define LOG_POLY1_ORDER 12
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const struct log_data {
|
||||
|
@ -24,5 +23,4 @@ extern const struct log_data {
|
|||
} __log_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_LOG_DATA_H_ */
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#define LOGF_TABLE_BITS 4
|
||||
#define LOGF_POLY_ORDER 4
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const struct logf_data {
|
||||
|
@ -16,5 +15,4 @@ extern const struct logf_data {
|
|||
} __logf_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_LOGF_DATA_INTERNAL_H_ */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_MAGICU_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_MAGICU_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct magicu {
|
||||
|
@ -31,5 +30,4 @@ static inline bool32 __magicu_valid(struct magicu d) {
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_MAGICU_H_ */
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#define POW_LOG_TABLE_BITS 7
|
||||
#define POW_LOG_POLY_ORDER 8
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const struct pow_log_data {
|
||||
|
@ -18,5 +17,4 @@ extern const struct pow_log_data {
|
|||
} __pow_log_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_POW_DATA_INTERNAL_H_ */
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#endif
|
||||
#define POWF_SCALE ((double)(1 << POWF_SCALE_BITS))
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const struct powf_log2_data {
|
||||
|
@ -21,5 +20,4 @@ extern const struct powf_log2_data {
|
|||
} __powf_log2_data;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_POWF_DATA_INTERNAL_H_ */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_TINYMATH_SINCOSF_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_TINYMATH_SINCOSF_INTERNAL_H_
|
||||
#include "libc/tinymath/internal.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
// clang-format off
|
||||
|
||||
|
@ -156,5 +155,4 @@ reduce_large (uint32_t xi, int *np)
|
|||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_SINCOSF_INTERNAL_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue