mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 12:18:31 +00:00
Fix build/test breakage caused by last commit
This commit is contained in:
parent
c45e46f871
commit
680daf1210
7 changed files with 14 additions and 11 deletions
|
@ -35,7 +35,7 @@ forcealignargpointer unsigned(getutf16)(const char16_t *p, wint_t *wc) {
|
|||
if (IsUcs2(p[skip])) {
|
||||
*wc = p[skip];
|
||||
return skip + 1;
|
||||
} else if (IsUtf16Cont(p[skip + 1])) {
|
||||
} else if (!IsUtf16Cont(p[skip + 1])) {
|
||||
*wc = INVALID_CODEPOINT;
|
||||
return -1;
|
||||
} else {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#define UTF16_CONT 0xdc00 /* 0xDC00..0xDBFF */
|
||||
|
||||
#define IsUcs2(wc) (((wc)&UTF16_MASK) != UTF16_MOAR)
|
||||
#define IsUtf16Cont(wc) (((wc)&UTF16_MASK) != UTF16_MOAR)
|
||||
#define IsUtf16Cont(wc) (((wc)&UTF16_MASK) == UTF16_CONT)
|
||||
#define MergeUtf16(lo, hi) ((((lo)-0xD800) << 10) + ((hi)-0xDC00) + 0x10000)
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_STR_UTF16_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue