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 @@
#define optreset __optreset
#define getopt __getopt
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern char *optarg;
@ -20,5 +19,4 @@ extern int optind, opterr, optopt, optreset;
int getopt(int, char *const[], const char *) paramsnonnull();
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_GETOPT_H_ */

View file

@ -29,7 +29,6 @@
SUCH DAMAGE.
*/
#include "libc/str/str.h"
// clang-format off
/*
* The SVID interface to getsubopt provides no way of figuring out which

View file

@ -3,7 +3,6 @@
#include "libc/str/str.h"
#include "third_party/getopt/long1.h"
#include "third_party/getopt/long2.h"
// clang-format off
/* $OpenBSD: getopt_long.c,v 1.32 2020/05/27 22:25:09 schwarze Exp $ */
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */

View file

@ -3,7 +3,6 @@
#ifdef COSMOPOLITAN_GETOPT_H_
#error "don't mix getopt_long() with cosmo's getopt()"
#endif
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern char *optarg;
@ -12,5 +11,4 @@ extern int optind, opterr, optopt, optreset;
int getopt(int, char *const *, const char *);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* _GETOPT_CORE_H */

View file

@ -8,7 +8,6 @@
#define required_argument 1
#define optional_argument 2
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct option {
@ -23,5 +22,4 @@ int getopt_long_only(int, char *const *, const char *, const struct option *,
int *);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* _GETOPT_EXT_H */