Add wcslen()

I think this can go in CString.h, no need to create a separate CWChar.h or something
This commit is contained in:
apio 2022-12-18 14:33:13 +01:00
parent 36179155e1
commit 9c1c6bb320
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 10 additions and 0 deletions

View File

@ -9,5 +9,7 @@ extern "C"
void* memmove(void* dest, const void* src, usize n); void* memmove(void* dest, const void* src, usize n);
usize strlen(const char* str); usize strlen(const char* str);
usize wcslen(const wchar_t* str);
char* strdup(const char* str); char* strdup(const char* str);
} }

View File

@ -46,6 +46,14 @@ extern "C"
return (usize)(i - str); return (usize)(i - str);
} }
usize wcslen(const wchar_t* str)
{
const wchar_t* i = str;
for (; *i; ++i)
;
return (usize)(i - str);
}
char* strdup(const char* str) char* strdup(const char* str)
{ {
const usize len = strlen(str); const usize len = strlen(str);