libluna: Add wcscmp

This commit is contained in:
apio 2023-04-28 20:00:26 +02:00
parent 15dcd6ad15
commit c5a867d81c
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 11 additions and 0 deletions

View File

@ -20,6 +20,7 @@ extern "C"
char* strtok(char* str, const char* delim);
usize wcslen(const wchar_t* str);
int wcscmp(const wchar_t* a, const wchar_t* b);
char* strdup(const char* str);
char* strndup(const char* str, usize max);

View File

@ -64,6 +64,16 @@ extern "C"
return *(const u8*)a - *(const u8*)b;
}
int wcscmp(const wchar_t* a, const wchar_t* b)
{
while (*a && (*a == *b))
{
a++;
b++;
}
return *(const u8*)a - *(const u8*)b;
}
int strncmp(const char* a, const char* b, usize max)
{
const char* s = a;