mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 06:12:27 +00:00
Perform build and magnum tuning
Building o//third_party/python now takes 5 seconds on my PC This change works towards modifying Python to use runtime dispatching when appropriate. For example, when loading the magnums in the socket module, it's a good idea to check if the magnum is zero, because that means the local system platform doesn't support it.
This commit is contained in:
parent
ee7e296339
commit
d26d7ae0e4
1028 changed files with 6576 additions and 172777 deletions
67
third_party/python/Modules/cjkcodecs/alg_jisx0201.inc
vendored
Normal file
67
third_party/python/Modules/cjkcodecs/alg_jisx0201.inc
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
/* clang-format off */
|
||||
|
||||
#define JISX0201_R_ENCODE(c, assi) \
|
||||
if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e) { \
|
||||
(assi) = (c); \
|
||||
} \
|
||||
else if ((c) == 0x00a5) { \
|
||||
(assi) = 0x5c; \
|
||||
} \
|
||||
else if ((c) == 0x203e) { \
|
||||
(assi) = 0x7e; \
|
||||
}
|
||||
|
||||
#define JISX0201_K_ENCODE(c, assi) \
|
||||
if ((c) >= 0xff61 && (c) <= 0xff9f) { \
|
||||
(assi) = (c) - 0xfec0; \
|
||||
}
|
||||
|
||||
#define JISX0201_ENCODE(c, assi) \
|
||||
JISX0201_R_ENCODE(c, assi) \
|
||||
else JISX0201_K_ENCODE(c, assi)
|
||||
|
||||
#define JISX0201_R_DECODE_CHAR(c, assi) \
|
||||
if ((c) < 0x5c) { \
|
||||
(assi) = (c); \
|
||||
} \
|
||||
else if ((c) == 0x5c) { \
|
||||
(assi) = 0x00a5; \
|
||||
} \
|
||||
else if ((c) < 0x7e) { \
|
||||
(assi) = (c); \
|
||||
} \
|
||||
else if ((c) == 0x7e) { \
|
||||
(assi) = 0x203e; \
|
||||
} \
|
||||
else if ((c) == 0x7f) { \
|
||||
(assi) = 0x7f; \
|
||||
}
|
||||
|
||||
#define JISX0201_R_DECODE(c, writer) \
|
||||
if ((c) < 0x5c) { \
|
||||
OUTCHAR(c); \
|
||||
} \
|
||||
else if ((c) == 0x5c) { \
|
||||
OUTCHAR(0x00a5); \
|
||||
} \
|
||||
else if ((c) < 0x7e) { \
|
||||
OUTCHAR(c); \
|
||||
} \
|
||||
else if ((c) == 0x7e) { \
|
||||
OUTCHAR(0x203e); \
|
||||
} \
|
||||
else if ((c) == 0x7f) { \
|
||||
OUTCHAR(0x7f); \
|
||||
}
|
||||
|
||||
#define JISX0201_K_DECODE(c, writer) \
|
||||
if ((c) >= 0xa1 && (c) <= 0xdf) { \
|
||||
OUTCHAR(0xfec0 + (c)); \
|
||||
}
|
||||
#define JISX0201_K_DECODE_CHAR(c, assi) \
|
||||
if ((c) >= 0xa1 && (c) <= 0xdf) { \
|
||||
(assi) = 0xfec0 + (c); \
|
||||
}
|
||||
#define JISX0201_DECODE(c, writer) \
|
||||
JISX0201_R_DECODE(c, writer) \
|
||||
else JISX0201_K_DECODE(c, writer)
|
Loading…
Add table
Add a link
Reference in a new issue