moargb/base.c
2020-08-30 15:27:11 +02:00

35 lines
604 B
C

#include <unistd.h>
#include <stdbool.h>
int __errno = 0;
void *_impure_ptr = NULL;
void __sinit(void) {
}
void *memset(void *s, int c, size_t n) {
char *end = (char *)s + n;
for (char *p = (char *)s; p < end; p++)
*p = (char)c;
return s;
}
void *memcpy(void *dest, const void *src, size_t n) {
uint8_t *out = (uint8_t *)dest;
const uint8_t *in = (const uint8_t *)src;
while (n--)
*out++ = *in++;
return dest;
}
size_t strlen(const char *s) {
const char *start = s;
while (*s++);
return s - start - 1;
}
void __assert_func(bool value) {
}