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

@ -3,7 +3,6 @@
#include "dsp/tty/quant.h"
#include "dsp/tty/ttyrgb.h"
#include "third_party/intel/xmmintrin.internal.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct TtyRgb rgb2tty24f_(ttyrgb_m128);
@ -30,5 +29,4 @@ char *setbgfg24_(char *, struct TtyRgb, struct TtyRgb);
struct TtyRgb rgb2ansi8_(int, int, int);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_DSP_TTY_INTERNAL_H_ */

View file

@ -17,7 +17,6 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "dsp/tty/itoa8.h"
#include "libc/intrin/bits.h"
#include "libc/str/str.h"
struct Itoa8 kItoa8;

View file

@ -1,7 +1,6 @@
#ifndef COSMOPOLITAN_DSP_TTY_ITOA8_H_
#define COSMOPOLITAN_DSP_TTY_ITOA8_H_
#include "libc/str/str.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct Itoa8 {
@ -17,5 +16,4 @@ forceinline char *itoa8(char *p, uint8_t c) {
}
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_DSP_TTY_ITOA8_H_ */

View file

@ -2,10 +2,8 @@
#define DSP_TTY_QUANT_H_
#include "dsp/tty/ttyrgb.h"
#include "libc/assert.h"
#include "libc/intrin/bits.h"
#include "libc/limits.h"
#include "libc/str/str.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#define TL 0
@ -90,5 +88,4 @@ forceinline bool ttyeq(struct TtyRgb x, struct TtyRgb y) {
}
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* DSP_TTY_QUANT_H_ */

View file

@ -3,7 +3,6 @@
#define kTtyIdScreen 83
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct FILE;
@ -55,5 +54,4 @@ void ttyhisto(uint32_t[hasatleast 256], uint8_t[hasatleast 256],
const uint8_t *, const uint8_t *, size_t);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_DSP_TTY_TTY_H_ */

View file

@ -22,7 +22,6 @@
#include "dsp/tty/ttyrgb.h"
#include "dsp/tty/windex.h"
#include "libc/assert.h"
#include "libc/intrin/bits.h"
#include "libc/intrin/safemacros.internal.h"
#include "libc/limits.h"
#include "libc/log/check.h"

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_DSP_TTY_RGB_H_
#define COSMOPOLITAN_DSP_TTY_RGB_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct TtyRgb {
@ -8,5 +7,4 @@ struct TtyRgb {
};
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_DSP_TTY_RGB_H_ */

View file

@ -1,10 +1,8 @@
#ifndef COSMOPOLITAN_DSP_TTY_WINDEX_H_
#define COSMOPOLITAN_DSP_TTY_WINDEX_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern unsigned (*windex)(uint16_t *, size_t);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_DSP_TTY_WINDEX_H_ */

View file

@ -1,10 +1,8 @@
#ifndef COSMOPOLITAN_DSP_TTY_XTERMNAME_H_
#define COSMOPOLITAN_DSP_TTY_XTERMNAME_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const char kXtermName[];
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_DSP_TTY_XTERMNAME_H_ */