mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Get TEST_LIBC_STR passing on AARCH64
It's now possible to run commands like: make -j8 m=aarch64 o/aarch64/test/libc/str Which will cross-compile and run the test suites in a qemu-aarch64 binary that's vendored in the third_party/qemu/ folder within your x86_64 build environment.
This commit is contained in:
parent
45186c74ac
commit
414667b1c9
24 changed files with 657 additions and 61 deletions
22
libc/str/wcwidth_osx.internal.h
Normal file
22
libc/str/wcwidth_osx.internal.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_STR_WCWIDTH_OSX_H_
|
||||
#define COSMOPOLITAN_LIBC_STR_WCWIDTH_OSX_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const uint32_t kWcwidthOsx[591];
|
||||
extern const uint8_t kWcwidthOsxIndex1[136];
|
||||
extern const uint16_t kWcwidthOsxIndex2[228];
|
||||
extern const uint32_t kWcwidthOsxIndex3[917];
|
||||
|
||||
static inline int _wcwidth_osx(uint32_t codePoint) {
|
||||
uint32_t a, b, c, d;
|
||||
a = kWcwidthOsxIndex1[codePoint >> 13];
|
||||
b = kWcwidthOsxIndex2[a + ((codePoint >> 9) & 0xf)];
|
||||
c = kWcwidthOsxIndex3[b + ((codePoint >> 5) & 0xf)];
|
||||
d = c + (codePoint & 0x1f);
|
||||
return (kWcwidthOsx[d >> 4] >> ((d & 0xf) << 1)) & 3;
|
||||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_STR_WCWIDTH_OSX_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue