mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
Start moving string.c to libretro-sdk/crt
This commit is contained in:
parent
1b63de1d02
commit
753f27c67c
34
libretro-sdk/crt/string.c
Normal file
34
libretro-sdk/crt/string.c
Normal file
@ -0,0 +1,34 @@
|
||||
#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;
|
||||
}
|
@ -30,7 +30,7 @@ CFLAGS += -Wall -O2 -ffreestanding -std=gnu99 $(MACHDEP) $(INCLUDE)
|
||||
|
||||
LDFLAGS := -T link.ld
|
||||
|
||||
OBJ = crt0.o dolloader.o elfloader.o main.o string.o sync.o
|
||||
OBJ = crt0.o dolloader.o elfloader.o main.o ../../libretro-sdk/crt/string.o sync.o
|
||||
|
||||
all: $(BIN_TARGET)
|
||||
|
||||
|
@ -1,25 +0,0 @@
|
||||
// Copyright 2008-2009 Segher Boessenkool <segher@kernel.crashing.org>
|
||||
// This code is licensed to you under the terms of the GNU GPL, version 2;
|
||||
// see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void *memset(void *b, int c, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
((unsigned char *)b)[i] = c;
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user