Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixelsuft committed Jul 5, 2024
1 parent ace0df9 commit 2148222
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#if !defined(_WIN32)
#define PREFER_SDL2
#endif
#define NOSTDLIB
// #define PREFER_STD
// #define FILES_WIN32_USE_ANSI

Expand Down
6 changes: 3 additions & 3 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void* h_memcpy(void* dst, const void* src, size_t n) {
return memcpy(dst, src, n);
#else
for (size_t i = 0; i < n; i++) {
*((uint8_t*)dst + (uint8_t*)i) = *((uint8_t*)src + (uint8_t*)i);
*(uint8_t*)((size_t)dst + i) = *(uint8_t*)((size_t)src + i);
}
return dst;
#endif
Expand All @@ -235,7 +235,7 @@ void* h_memmove(void* dst, const void* src, size_t n) {
#else
// TODO
for (size_t i = 0; i < n; i++) {
*((uint8_t*)dst + (uint8_t*)i) = *((uint8_t*)src + (uint8_t*)i);
*(uint8_t*)((size_t)dst + i) = *(uint8_t*)((size_t)src + i);
}
return dst;
#endif
Expand Down Expand Up @@ -265,7 +265,7 @@ void* h_memset(void* dst, int ch, size_t n) {
return memset(dst, ch, n);
#else
for (size_t i = 0; i < n; i++) {
*((uint8_t*)dst + (uint8_t*)i) = (uint8_t)ch;
*(uint8_t*)((size_t)dst + i) = (uint8_t)ch;
}
return dst;
#endif
Expand Down

0 comments on commit 2148222

Please sign in to comment.