mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 10:48:29 +00:00
Add Musl multibyte functions
These are standard functions that are needed to help support the Skull language. Note that normally this codebase uses libc/str/thompike.h See #105
This commit is contained in:
parent
cfd453d125
commit
11ec99931b
28 changed files with 1064 additions and 131 deletions
|
@ -16,12 +16,16 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bigword.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#define wmemset memset16
|
||||
#define T unsigned short
|
||||
#define N (BIGWORD / sizeof(T))
|
||||
#include "libc/nexgen32e/wmemset.inc"
|
||||
#undef wmemset
|
||||
#undef T
|
||||
#undef N
|
||||
|
||||
/**
|
||||
* Sets wide memory.
|
||||
* @asyncsignalsafe
|
||||
*/
|
||||
char16_t *memset16(char16_t *p, char16_t c, size_t n) {
|
||||
size_t i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
p[i] = c;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue