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

@ -11,7 +11,6 @@
#include "third_party/python/Include/pgenheaders.h"
#include "third_party/python/Include/token.h"
#include "third_party/python/Parser/parser.h"
/* clang-format off */
/* The parser as originally conceived had disappointing performance.
This module does some precomputation that speeds up the selection

View file

@ -1288,7 +1288,6 @@ def main(srcfile, dump_module=False):
#include \"third_party/python/Include/asdl.h\"\n\
#if !(__ASSEMBLER__ + __LINKER__ + 0)\n\
COSMOPOLITAN_C_START_\n\
/* clang-format off */\n\
/* File automatically generated by %s. */\n\
\n\
" % argv0)
@ -1323,7 +1322,6 @@ COSMOPOLITAN_C_END_\n\
#include "third_party/python/Include/pythonrun.h"\n\
#include "third_party/python/Include/tupleobject.h"\n\
#include "third_party/python/Include/yoink.h"\n\
/* clang-format off */\n\
\n\
PYTHON_PROVIDE("_ast");\n\
\n\

View file

@ -6,7 +6,6 @@
*/
#include "third_party/python/Include/bitset.h"
#include "third_party/python/Include/objimpl.h"
/* clang-format off */
bitset
newbitset(int nbits)

View file

@ -9,7 +9,6 @@
#include "third_party/python/Include/objimpl.h"
#include "third_party/python/Include/pgenheaders.h"
#include "third_party/python/Include/token.h"
/* clang-format off */
extern int Py_DebugFlag;

View file

@ -10,7 +10,6 @@
#include "third_party/python/Include/pgenheaders.h"
#include "third_party/python/Include/pyerrors.h"
#include "third_party/python/Include/token.h"
/* clang-format off */
extern int Py_DebugFlag;

View file

@ -8,7 +8,6 @@
#include "third_party/python/Include/grammar.h"
#include "third_party/python/Include/pyerrors.h"
#include "third_party/python/Include/token.h"
/* clang-format off */
/* Return the DFA for the given type */
dfa *

View file

@ -8,7 +8,6 @@
#include "third_party/python/Include/node.h"
#include "third_party/python/Include/pgenheaders.h"
#include "third_party/python/Include/token.h"
/* clang-format off */
static void list1node(FILE *, node *);
static void listnode(FILE *, node *);

View file

@ -8,7 +8,6 @@
#include "third_party/python/Include/metagrammar.h"
#include "third_party/python/Include/pgen.h"
#include "third_party/python/Include/pgenheaders.h"
/* clang-format off */
static arc arcs_0_0[3] = {
{2, 0},

View file

@ -14,7 +14,6 @@
#include "third_party/python/Include/pyerrors.h"
#include "third_party/python/Include/pymem.h"
#include "third_party/python/Include/pystate.h"
/* clang-format off */
/* Readline interface for tokenizer.c and [raw_]input() in bltinmodule.c.
By default, or when stdin is not a tty device, we have a super

View file

@ -9,7 +9,6 @@
#include "third_party/python/Include/errcode.h"
#include "third_party/python/Include/node.h"
#include "third_party/python/Include/objimpl.h"
/* clang-format off */
node *
PyNode_New(int type)

View file

@ -13,7 +13,6 @@
#include "third_party/python/Include/pymem.h"
#include "third_party/python/Include/token.h"
#include "third_party/python/Parser/parser.h"
/* clang-format off */
/*

View file

@ -3,7 +3,6 @@
#include "third_party/python/Include/grammar.h"
#include "third_party/python/Include/node.h"
COSMOPOLITAN_C_START_
/* clang-format off */
#define MAXSTACK 1500

View file

@ -14,7 +14,6 @@
#include "third_party/python/Include/pyerrors.h"
#include "third_party/python/Parser/parser.h"
#include "third_party/python/Parser/tokenizer.h"
/* clang-format off */
static node *parsetok(struct tok_state *, grammar *, int, perrdetail *, int *);
static int initerr(perrdetail *err_ret, PyObject * filename);

View file

@ -11,7 +11,6 @@
#include "third_party/python/Include/pgen.h"
#include "third_party/python/Include/pgenheaders.h"
#include "third_party/python/Include/token.h"
/* clang-format off */
/*

View file

@ -14,7 +14,6 @@
#include "third_party/python/Include/pgenheaders.h"
#include "third_party/python/Include/pyerrors.h"
#include "third_party/python/Include/pymem.h"
/* clang-format off */
/* This expects a filename containing the grammar as argv[1] (UNIX)
or asks the console for such a file name (THINK C).

View file

@ -7,7 +7,6 @@
#define PGEN
#include "third_party/python/Include/grammar.h"
#include "third_party/python/Include/pgenheaders.h"
/* clang-format off */
/* Print a bunch of C initializers that represent a grammar */

View file

@ -25,7 +25,6 @@
#include "third_party/python/Include/sysmodule.h"
#include "third_party/python/Include/unicodeobject.h"
#endif
/* clang-format off */
/* Tokenizer implementation */

View file

@ -5,7 +5,6 @@
#ifdef __cplusplus
extern "C" {
#endif
/* clang-format off */
#define MAXINDENT 100 /* Max indentation level */