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

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_AUXV_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_AUXV_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_auxv_t {
uint64_t a_type;
@ -9,5 +8,4 @@ typedef struct Elf64_auxv_t {
} a_un;
} Elf64_auxv_t;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_AUXV_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_CHDR_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_CHDR_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Chdr {
Elf64_Word ch_type;
@ -10,5 +9,4 @@ typedef struct Elf64_Chdr {
Elf64_Xword ch_addralign;
} Elf64_Chdr;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_CHDR_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_DYN_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_DYN_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Dyn {
Elf64_Sxword d_tag;
@ -11,5 +10,4 @@ typedef struct Elf64_Dyn {
} d_un;
} Elf64_Dyn;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_DYN_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_EHDR_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_EHDR_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
/*
* ELF header.
@ -159,5 +158,4 @@ typedef struct Elf64_Ehdr {
} Elf64_Ehdr;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_EHDR_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_LIB_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_LIB_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Lib {
Elf64_Word l_name;
@ -11,5 +10,4 @@ typedef struct Elf64_Lib {
Elf64_Word l_flags;
} Elf64_Lib;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_LIB_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_MOVE_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_MOVE_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Move {
Elf64_Xword m_value;
@ -11,5 +10,4 @@ typedef struct Elf64_Move {
Elf64_Half m_stride;
} Elf64_Move;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_MOVE_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_NHDR_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_NHDR_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Nhdr {
Elf64_Word n_namesz;
@ -9,5 +8,4 @@ typedef struct Elf64_Nhdr {
Elf64_Word n_type;
} Elf64_Nhdr;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_NHDR_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_PHDR_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_PHDR_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Phdr {
Elf64_Word p_type;
@ -14,5 +13,4 @@ typedef struct Elf64_Phdr {
Elf64_Xword p_align;
} Elf64_Phdr;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_PHDR_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_REL_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_REL_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
/*
* ELF relocation.
@ -50,5 +49,4 @@ typedef struct Elf64_Rel {
} Elf64_Rel;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_REL_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_RELA_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_RELA_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
/*
* ELF relocation w/ explicit addend.
@ -62,5 +61,4 @@ typedef struct Elf64_Rela {
} Elf64_Rela;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_RELA_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_SHDR_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_SHDR_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
/**
* Section header.
@ -48,5 +47,4 @@ typedef struct Elf64_Shdr {
} Elf64_Shdr;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_SHDR_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_SYM_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_SYM_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Sym {
@ -92,5 +91,4 @@ typedef struct Elf64_Sym {
} Elf64_Sym;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_SYM_H_ */

View file

@ -1,12 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_SYMINFO_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_SYMINFO_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Syminfo {
Elf64_Half si_boundto;
Elf64_Half si_flags;
} Elf64_Syminfo;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_SYMINFO_H_ */

View file

@ -1,12 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_VERDAUX_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_VERDAUX_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Verdaux {
Elf64_Word vda_name;
Elf64_Word vda_next;
} Elf64_Verdaux;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_VERDAUX_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_VERDEF_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_VERDEF_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Verdef {
Elf64_Half vd_version;
@ -13,5 +12,4 @@ typedef struct Elf64_Verdef {
Elf64_Word vd_next;
} Elf64_Verdef;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_VERDEF_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_VERNAUX_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_VERNAUX_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Vernaux {
Elf64_Word vna_hash;
@ -11,5 +10,4 @@ typedef struct Elf64_Vernaux {
Elf64_Word vna_next;
} Elf64_Vernaux;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_VERNAUX_H_ */

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ELF_STRUCT_VERNEED_H_
#define COSMOPOLITAN_LIBC_ELF_STRUCT_VERNEED_H_
#include "libc/elf/scalar.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
typedef struct Elf64_Verneed {
Elf64_Half vn_version;
@ -11,5 +10,4 @@ typedef struct Elf64_Verneed {
Elf64_Word vn_next;
} Elf64_Verneed;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_ELF_STRUCT_VERNEED_H_ */