mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Add MODE=optlinux build mode (#141)
This commit is contained in:
parent
226aaf3547
commit
67b5200a0b
111 changed files with 934 additions and 854 deletions
|
@ -21,19 +21,29 @@
|
|||
#include "libc/str/tpenc.h"
|
||||
#include "libc/str/utf16.h"
|
||||
|
||||
#define ToUpper(c) ((c) >= 'a' && (c) <= 'z' ? (c) - 'a' + 'A' : (c))
|
||||
|
||||
static textwindows noasan noinstrument axdx_t Recode16to8(char *dst,
|
||||
size_t dstsize,
|
||||
const char16_t *src) {
|
||||
bool v;
|
||||
axdx_t r;
|
||||
uint64_t w;
|
||||
wint_t x, y;
|
||||
for (r.ax = 0, r.dx = 0;;) {
|
||||
for (v = r.ax = 0, r.dx = 0;;) {
|
||||
if (!(x = src[r.dx++])) break;
|
||||
if (IsUtf16Cont(x)) continue;
|
||||
if (!IsUcs2(x)) {
|
||||
y = src[r.dx++];
|
||||
x = MergeUtf16(x, y);
|
||||
}
|
||||
if (!v) {
|
||||
if (x == '=') {
|
||||
v = true;
|
||||
} else {
|
||||
x = ToUpper(x);
|
||||
}
|
||||
}
|
||||
w = tpenc(x);
|
||||
do {
|
||||
if (r.ax + 1 >= dstsize) break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue