mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 17:01:35 +01:00
basic-handsum-decode: use memcpy unless __wasm__
This commit is contained in:
1 parent
67591a3570
commit
ee923a973c
1 file changed
+5
-2
@@ -79,8 +79,7 @@ basic_handsum_decode__decode(basic_handsum_decode__pixel_buffer* dst,
|
|||||||
|
|
||||||
#ifdef BASIC_HANDSUM_DECODE_IMPLEMENTATION
|
#ifdef BASIC_HANDSUM_DECODE_IMPLEMENTATION
|
||||||
|
|
||||||
// We implement memcpy ourselves, instead of using "#include <string.h>", so
|
#ifdef __wasm__
|
||||||
// that we can compile this snippet with --target=wasm32.
|
|
||||||
static void //
|
static void //
|
||||||
basic_handsum_decode__memcpy(uint8_t* restrict dst,
|
basic_handsum_decode__memcpy(uint8_t* restrict dst,
|
||||||
const uint8_t* restrict src,
|
const uint8_t* restrict src,
|
||||||
@@ -89,6 +88,10 @@ basic_handsum_decode__memcpy(uint8_t* restrict dst,
|
|||||||
*dst++ = *src++;
|
*dst++ = *src++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#include <string.h>
|
||||||
|
#define basic_handsum_decode__memcpy memcpy
|
||||||
|
#endif
|
||||||
|
|
||||||
static void //
|
static void //
|
||||||
basic_handsum_decode__smooth_block_seams_16x16(uint8_t* b) {
|
basic_handsum_decode__smooth_block_seams_16x16(uint8_t* b) {
|
||||||
|
|||||||
Reference in new issue
Block a user