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:
Justine Tunney 2023-11-28 14:24:28 -08:00
parent 96f979dfc5
commit fa20edc44d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3057 changed files with 410 additions and 4398 deletions

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
void
freedtoa(char *s)

View file

@ -31,7 +31,6 @@
*/
#include "libc/runtime/fenv.h"
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string.
*

View file

@ -32,7 +32,6 @@
#include "libc/str/str.h"
#include "third_party/gdtoa/gdtoa.h"
#include "third_party/gdtoa/gdtoa.internal.h"
// clang-format off
/**
* Converts quadruple-precision floating-point number to string.

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
#define dlen 0
#define HEXDIG "0123456789abcdef"

View file

@ -31,7 +31,6 @@
*/
#include "libc/runtime/fenv.h"
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
char *
g_ddfmt(char *buf, double *dd0, int ndig, size_t bufsize)

View file

@ -32,7 +32,6 @@
#include "libc/runtime/fenv.h"
#include "libc/str/str.h"
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
extern ULong __gdtoa_NanDflt_d[2];

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
char*
g_dfmt(char *buf, double *d, int ndig, size_t bufsize)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
extern ULong __gdtoa_NanDflt_d[2];

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
char*
g_ffmt(char *buf, float *f, int ndig, size_t bufsize)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
extern ULong __gdtoa_NanDflt_f[1];

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
char*
g_xfmt(char *buf, void *V, int ndig, size_t bufsize)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
extern UShort __gdtoa_NanDflt_ldus[5];

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
static Bigint *
bitstob(ULong *bits, int nbits, int *bbits, ThInfo **PTI)

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_THIRD_PARTY_GDTOA_GDTOA_H_
#define COSMOPOLITAN_THIRD_PARTY_GDTOA_GDTOA_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#define dtoa __dtoa
@ -135,5 +134,4 @@ int strtopx(const char *, char **, void *);
int strtopxL(const char *, char **, void *);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_GDTOA_GDTOA_H_ */

View file

@ -1,4 +1,3 @@
/* clang-format off */
FPI fpi1;
int Rounding;

View file

@ -31,7 +31,6 @@
*/
#include "libc/errno.h"
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
int
__gdtoa_gethex(const char **sp, const FPI *fpi,

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
void
__gdtoa_rshift(Bigint *b, int k)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
static void
L_shift(ULong *x, ULong *x1, int i)

View file

@ -35,7 +35,6 @@
#include "libc/thread/thread.h"
#include "libc/thread/tls.h"
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
static ThInfo TI0;
static pthread_mutex_t __gdtoa_lock_obj;

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
Bigint *
__gdtoa_s2b(const char *s, int nd0, int nd, ULong y9, int dplen, ThInfo **PTI)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
int
strtoId(const char *s, char **sp, double *f0, double *f1)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
int
strtoIdd(const char *s, char **sp, double *f0, double *f1)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
int
strtoIf(const char *s, char **sp, float *f0, float *f1)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
int
__gdtoa_strtoIg(const char *s00, char **se, const FPI *fpi, Long *exp, Bigint **B, int *rvp)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
int
strtoIx(const char *s, char **sp, void *a, void *b)

View file

@ -33,7 +33,6 @@
#include "libc/fmt/conv.h"
#include "libc/runtime/fenv.h"
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
#define Avoid_Underflow
#define dplen 1

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
static double
__gdtoa_ulpdown(U *d)

View file

@ -31,7 +31,6 @@
*/
#include "libc/errno.h"
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
static const int
fivesbits[] = { 0, 3, 5, 7, 10, 12, 14, 17, 19, 21,

View file

@ -32,7 +32,6 @@
#include "libc/fmt/conv.h"
#include "third_party/gdtoa/gdtoa.h"
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
float
strtof(const char *s, char **sp)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
int
strtopd(const char *s, char **sp, double *d)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
int
strtopdd(const char *s, char **sp, double *dd)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
int
strtopf(const char *s, char **sp, float *f)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
extern UShort __gdtoa_NanDflt_ldus[5];

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
extern ULong __gdtoa_NanDflt_d[2];

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
extern ULong __gdtoa_NanDflt_d[2];

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
extern ULong __gdtoa_NanDflt_f[1];

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
extern UShort __gdtoa_NanDflt_ldus[5];

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
Bigint *
__gdtoa_sum(Bigint *a, Bigint *b, ThInfo **PTI)

View file

@ -30,7 +30,6 @@
*/
#include "third_party/gdtoa/gdtoa.internal.h"
/* clang-format off */
double
__gdtoa_ulp(U *x)