void *memcpy(void *restrict dest, const void *restrict src, size_t n)
{
+#if defined(__wasm_bulk_memory__)
+ return __builtin_memcpy(dest, src, n);
+#else
unsigned char *d = dest;
const unsigned char *s = src;
for (; n; n--) *d++ = *s++;
return dest;
+#endif // __wasm_bulk_memory__
}
void *memmove(void *dest, const void *src, size_t n)
{
+#if defined(__wasm_bulk_memory__)
+ return __builtin_memmove(dest, src, n);
+#else
char *d = dest;
const char *s = src;
}
return dest;
+#endif // __wasm_bulk_memory__
}
void *memset(void *dest, int c, size_t n)
{
+#if defined(__wasm_bulk_memory__)
+ return __builtin_memset(dest, c, n);
+#else
unsigned char *s = dest;
size_t k;
#endif
return dest;
+#endif // __wasm_bulk_memory__
}
wchar_t *wmemcpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n)
{
+#if defined(__wasm_bulk_memory__)
+ return __builtin_wmemcpy(d, s, n);
+#else
wchar_t *a = d;
while (n--) *d++ = *s++;
return a;
+#endif // __wasm_bulk_memory__
}
wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n)
{
+#if defined(__wasm_bulk_memory__)
+ return __builtin_wmemmove(d, s, n);
+#else
wchar_t *d0 = d;
if (d == s) return d;
if ((uintptr_t)d-(uintptr_t)s < n * sizeof *d)
else
while (n--) *d++ = *s++;
return d0;
+#endif // __wasm_bulk_memory__
}