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

@ -4,9 +4,7 @@
#include "libc/limits.h"
#include "libc/literal.h"
#include "libc/stdio/stdio.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
/* clang-format off */
typedef double Awkfloat;
@ -412,5 +410,4 @@ extern Cell *gsub(Node **, int);
extern const char *flags2str(int flags);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_AWK_AWK_H_ */

View file

@ -1,4 +1,3 @@
// clang-format off
#include "libc/mem/mem.h"
#include "libc/str/str.h"
#define YYBYACC 1

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_THIRD_PARTY_AWK_AWKGRAM_TAB_H_
#define COSMOPOLITAN_THIRD_PARTY_AWK_AWKGRAM_TAB_H_
#include "third_party/awk/awk.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#define FIRSTTOKEN 257
@ -111,5 +110,4 @@ typedef union {
extern YYSTYPE yylval;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_AWK_AWKGRAM_TAB_H_ */

1
third_party/awk/b.c vendored
View file

@ -31,7 +31,6 @@
#include "libc/str/str.h"
#include "third_party/awk/awk.h"
#include "third_party/awk/awkgram.tab.h"
// clang-format off
/* lasciate ogne speranza, voi ch'intrate. */

View file

@ -1,10 +1,8 @@
#ifndef COSMOPOLITAN_THIRD_PARTY_AWK_CMD_H_
#define COSMOPOLITAN_THIRD_PARTY_AWK_CMD_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
int _awk(int, char *[]);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_AWK_CMD_H_ */

View file

@ -34,7 +34,6 @@
#include "third_party/awk/awk.h"
#include "third_party/awk/awkgram.tab.h"
#include "third_party/gdtoa/gdtoa.h"
// clang-format off
extern bool infunc;

View file

@ -35,7 +35,6 @@
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"
#include "third_party/awk/awk.h"
// clang-format off
char EMPTY[] = { '\0' };
static FILE *infile = NULL;

View file

@ -38,7 +38,6 @@
#include "libc/sysv/consts/sicode.h"
#include "libc/sysv/consts/sig.h"
#include "third_party/awk/awk.h"
// clang-format off
asm(".ident\t\"\\n\\n\
Copyright (C) Lucent Technologies 1997\\n\

View file

@ -31,7 +31,6 @@
#include "libc/str/str.h"
#include "third_party/awk/awk.h"
#include "third_party/awk/awkgram.tab.h"
// clang-format off
/*
* this program makes the table to link function names

View file

@ -30,7 +30,6 @@
#include "libc/str/str.h"
#include "third_party/awk/awk.h"
#include "third_party/awk/awkgram.tab.h"
// clang-format off
Node *nodealloc(int n)
{

View file

@ -27,7 +27,6 @@
*/
#include "third_party/awk/awk.h"
#include "third_party/awk/awkgram.tab.h"
// clang-format off
static const char * const printname[95] = {
"FIRSTTOKEN", /* 258 */

View file

@ -39,7 +39,6 @@
#include "third_party/awk/awk.h"
#include "third_party/awk/awkgram.tab.h"
#include "third_party/libcxx/math.h"
// clang-format off
static void stdinit(void);
static void flush_all(void);

View file

@ -31,7 +31,6 @@
#include "libc/mem/mem.h"
#include "libc/str/str.h"
#include "third_party/awk/awk.h"
// clang-format off
#define FULLTAB 2 /* rehash when table gets this x full */
#define GROWTAB 4 /* grow table by this factor */