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 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __big5_decmap_ptr;
static const unsigned char __big5_decmap_rodata[14386] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __big5_encmap_ptr;
static const unsigned char __big5_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __big5hkscs_bmp_encmap_ptr;
static const unsigned char __big5hkscs_bmp_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __big5hkscs_decmap_ptr;
static const unsigned char __big5hkscs_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __big5hkscs_nonbmp_encmap_ptr;
static const unsigned char __big5hkscs_nonbmp_encmap_rodata[] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __cp932ext_decmap_ptr;
static const unsigned char __cp932ext_decmap_rodata[872] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __cp932ext_encmap_ptr;
static const unsigned char __cp932ext_encmap_rodata[] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __cp949_encmap_ptr;
static const unsigned char __cp949_encmap_rodata[29600] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __cp949ext_decmap_ptr;
static const unsigned char __cp949ext_decmap_rodata[1970] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __cp950ext_decmap_ptr;
static const unsigned char __cp950ext_decmap_rodata[92] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __cp950ext_encmap_ptr;
static const unsigned char __cp950ext_encmap_rodata[] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __gb18030ext_decmap_ptr;
static const unsigned char __gb18030ext_decmap_rodata[405] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __gb18030ext_encmap_ptr;
static const unsigned char __gb18030ext_encmap_rodata[400] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __gb2312_decmap_ptr;
static const unsigned char __gb2312_decmap_rodata[11651] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __gbcommon_encmap_ptr;
static const unsigned char __gbcommon_encmap_rodata[26264] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __gbkext_decmap_ptr;
static const unsigned char __gbkext_decmap_rodata[3936] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __jisx0208_decmap_ptr;
static const unsigned char __jisx0208_decmap_rodata[9445] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __jisx0212_decmap_ptr;
static const unsigned char __jisx0212_decmap_rodata[3327] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __jisx0213_1_bmp_decmap_ptr;
static const unsigned char __jisx0213_1_bmp_decmap_rodata[2205] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __jisx0213_1_emp_decmap_ptr;
static const unsigned char __jisx0213_1_emp_decmap_rodata[] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __jisx0213_2_bmp_decmap_ptr;
static const unsigned char __jisx0213_2_bmp_decmap_rodata[3265] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __jisx0213_2_emp_decmap_ptr;
static const unsigned char __jisx0213_2_emp_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __jisx0213_bmp_encmap_ptr;
static const unsigned char __jisx0213_bmp_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __jisx0213_emp_encmap_ptr;
static const unsigned char __jisx0213_emp_encmap_rodata[] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __jisx0213_pair_decmap_ptr;
static const unsigned char __jisx0213_pair_decmap_rodata[71] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) __jisxcommon_encmap_ptr;
static const unsigned char __jisxcommon_encmap_rodata[] = {

View file

@ -1,6 +1,5 @@
#include "libc/x/x.h"
#include "third_party/python/Modules/cjkcodecs/xloadzd.h"
/* clang-format off */
static _Atomic(void *) __ksx1001_decmap_ptr;
static const unsigned char __ksx1001_decmap_rodata[10685] = {

View file

@ -7,7 +7,6 @@
#include "third_party/python/Include/import.h"
#include "third_party/python/Include/yoink.h"
#include "third_party/python/Modules/cjkcodecs/cjkcodecs.h"
/* clang-format off */
PYTHON_PROVIDE("_codecs_cn");
PYTHON_PROVIDE("_codecs_cn.__map_gb18030ext");

View file

@ -9,7 +9,6 @@
#include "third_party/python/Include/yoink.h"
#include "third_party/python/Modules/cjkcodecs/cjkcodecs.h"
#include "third_party/python/Modules/cjkcodecs/somanyencodings.h"
/* clang-format off */
PYTHON_PROVIDE("_codecs_hk");
PYTHON_PROVIDE("_codecs_hk.__map_big5hkscs");

View file

@ -4,7 +4,6 @@
Python 3
https://docs.python.org/3/license.html │
*/
/* clang-format off */
/*
* _codecs_iso2022.c: Codecs collection for ISO-2022 encodings.

View file

@ -4,7 +4,6 @@
Python 3
https://docs.python.org/3/license.html │
*/
/* clang-format off */
/*
* _codecs_jp.c: Codecs collection for Japanese encodings
*

View file

@ -4,7 +4,6 @@
Python 3
https://docs.python.org/3/license.html │
*/
/* clang-format off */
/*
* _codecs_kr.c: Codecs collection for Korean encodings

View file

@ -1,4 +1,3 @@
/* clang-format off */
/*
* _codecs_tw.c: Codecs collection for Taiwan's encodings
*

View file

@ -1,4 +1,3 @@
/* clang-format off */
#define JISX0201_R_ENCODE(c, assi) \
if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e) { \

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) big5_decmap_ptr;
static const unsigned char big5_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) big5_encmap_ptr;
static const unsigned char big5_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) big5hkscs_bmp_encmap_ptr;
static const unsigned char big5hkscs_bmp_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) big5hkscs_decmap_ptr;
static const unsigned char big5hkscs_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) big5hkscs_nonbmp_encmap_ptr;
static const unsigned char big5hkscs_nonbmp_encmap_rodata[] = {

View file

@ -10,7 +10,6 @@
#include "third_party/python/Include/pymacro.h"
#include "third_party/python/Modules/cjkcodecs/multibytecodec.h"
#include "third_party/python/Modules/cjkcodecs/somanyencodings.h"
/* clang-format off */
/* a unicode "undefined" code point */
#define UNIINV 0xFFFE

View file

@ -1,4 +1,3 @@
/* clang-format off */
/*[clinic input]
preserve
[clinic start generated code]*/

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) cp932ext_decmap_ptr;
static const unsigned char cp932ext_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) cp932ext_encmap_ptr;
static const unsigned char cp932ext_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) cp949_encmap_ptr;
static const unsigned char cp949_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) cp949ext_decmap_ptr;
static const unsigned char cp949ext_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) cp950ext_decmap_ptr;
static const unsigned char cp950ext_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) cp950ext_encmap_ptr;
static const unsigned char cp950ext_encmap_rodata[] = {

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* These routines may be quite inefficient, but it's used only to emulate old
* standards. */

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) gb18030ext_decmap_ptr;
static const unsigned char gb18030ext_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) gb18030ext_encmap_ptr;
static const unsigned char gb18030ext_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) gb2312_decmap_ptr;
static const unsigned char gb2312_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) gbcommon_encmap_ptr;
static const unsigned char gbcommon_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) gbkext_decmap_ptr;
static const unsigned char gbkext_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0208_decmap_ptr;
static const unsigned char jisx0208_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0212_decmap_ptr;
static const unsigned char jisx0212_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0213_1_bmp_decmap_ptr;
static const unsigned char jisx0213_1_bmp_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0213_1_emp_decmap_ptr;
static const unsigned char jisx0213_1_emp_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0213_2_bmp_decmap_ptr;
static const unsigned char jisx0213_2_bmp_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0213_2_emp_decmap_ptr;
static const unsigned char jisx0213_2_emp_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0213_bmp_encmap_ptr;
static const unsigned char jisx0213_bmp_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0213_emp_encmap_ptr;
static const unsigned char jisx0213_emp_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0213_pair_decmap_ptr;
static const unsigned char jisx0213_pair_decmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisx0213_pair_encmap_ptr;
static const unsigned char jisx0213_pair_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) jisxcommon_encmap_ptr;
static const unsigned char jisxcommon_encmap_rodata[] = {

View file

@ -1,5 +1,4 @@
#include "libc/x/x.h"
/* clang-format off */
static _Atomic(void *) ksx1001_decmap_ptr;
static const unsigned char ksx1001_decmap_rodata[] = {

View file

@ -20,7 +20,6 @@
#include "third_party/python/Include/structmember.h"
#include "third_party/python/Include/tupleobject.h"
#include "third_party/python/Include/yoink.h"
/* clang-format off */
PYTHON_PROVIDE("_multibytecodec");
PYTHON_PROVIDE("_multibytecodec.MultibyteIncrementalDecoder");

View file

@ -2,7 +2,6 @@
#define _PYTHON_MULTIBYTECODEC_H_
#include "third_party/python/Include/unicodeobject.h"
COSMOPOLITAN_C_START_
/* clang-format off */
/*
* multibytecodec.h: Common Multibyte Codec Implementation

View file

@ -3,7 +3,6 @@
#define JISX0213_ENCPAIRS 46
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct CjkIndex {
@ -79,5 +78,4 @@ const uint16_t *__ksx1001_decmap(void) pureconst;
const uint32_t *__jisx0213_pair_decmap(void) pureconst;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /*COSMOPOLITAN_THIRD_PARTY_PYTHON_MODULES_CJKCODECS_SOMANYENCODINGS_H_*/

View file

@ -1,11 +1,9 @@
#ifndef COSMOPOLITAN_THIRD_PARTY_PYTHON_MODULES_CJKCODECS_XLOADZD_H_
#define COSMOPOLITAN_THIRD_PARTY_PYTHON_MODULES_CJKCODECS_XLOADZD_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
void *xloadzd(_Atomic(void *) *, const void *, size_t, size_t, size_t, size_t,
uint32_t);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_PYTHON_MODULES_CJKCODECS_XLOADZD_H_ */