mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 10:49:02 +00:00
35 lines
640 B
C
35 lines
640 B
C
#ifdef _MSC_VER
|
|
#include <cruntime.h>
|
|
#endif
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
void *memset(void *dst, int val, size_t count)
|
|
{
|
|
void *start = dst;
|
|
|
|
#if defined(_M_IA64) || defined (_M_AMD64) || defined(_M_ALPHA) || defined (_M_PPC)
|
|
extern void RtlFillMemory(void *, size_t count, char);
|
|
|
|
RtlFillMemory(dst, count, (char)val);
|
|
#else
|
|
while (count--)
|
|
{
|
|
*(char*)dst = (char)val;
|
|
dst = (char*)dst + 1;
|
|
}
|
|
#endif
|
|
|
|
return start;
|
|
}
|
|
|
|
void *memcpy(void *dst, const void *src, size_t len)
|
|
{
|
|
size_t i;
|
|
|
|
for (i = 0; i < len; i++)
|
|
((unsigned char *)dst)[i] = ((unsigned char *)src)[i];
|
|
|
|
return dst;
|
|
}
|