]> git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/src/string/wmemcpy.c
Use bulk memory opcodes when possible
[wasi-libc.git] / libc-top-half / musl / src / string / wmemcpy.c
1 #include <wchar.h>
2
3 wchar_t *wmemcpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n)
4 {
5 #if defined(__wasm_bulk_memory__)
6 return __builtin_wmemcpy(d, s, n);
7 #else
8 wchar_t *a = d;
9 while (n--) *d++ = *s++;
10 return a;
11 #endif // __wasm_bulk_memory__
12 }