mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +00:00
LibC: Implement wmemcmp
This commit is contained in:
parent
685045176b
commit
57f0c12b9a
2 changed files with 10 additions and 0 deletions
|
@ -541,4 +541,13 @@ size_t mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps)
|
|||
// If we are here, we have written `len` wchars, but not reached the null byte.
|
||||
return written;
|
||||
}
|
||||
|
||||
int wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n)
|
||||
{
|
||||
while (n-- > 0) {
|
||||
if (*s1++ != *s2++)
|
||||
return s1[-1] < s2[-1] ? -1 : 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,5 +60,6 @@ int swprintf(wchar_t*, size_t, const wchar_t*, ...);
|
|||
int wcwidth(wchar_t);
|
||||
size_t wcsrtombs(char*, const wchar_t**, size_t, mbstate_t*);
|
||||
size_t mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*);
|
||||
int wmemcmp(const wchar_t*, const wchar_t*, size_t);
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue