Add memcmp(), clean up bochsrc.txt

This commit is contained in:
2025-12-11 00:53:29 +01:00
parent 6feea1444a
commit 172859831d
3 changed files with 21 additions and 0 deletions

View File

@@ -60,3 +60,16 @@ usize_t strlen(const char *str) {
for (s = str; *s; ++s);
return (s - str);
}
int memcmp(const void *s1, const void *s2, usize_t n) {
unsigned char *p = (unsigned char *)s1;
unsigned char *q = (unsigned char *)s2;
while (n--) {
if (*p != *q) {
return (int)*p - (int)*q;
}
p++, q++;
}
return 0;
}