libc: Add strcoll()
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-08-08 14:40:14 +02:00
parent 37e9b25b62
commit 8c13513bf4
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 9 additions and 0 deletions

View File

@ -95,6 +95,9 @@ extern "C"
/* Compare two fixed-size null-terminated strings, ignoring case. */
int strncasecmp(const char* a, const char* b, size_t max);
/* Compare two null-terminated strings according to the current locale. */
int strcoll(const char* a, const char* b);
#ifdef __cplusplus
}
#endif

View File

@ -9,6 +9,12 @@ extern "C"
extern "C++" const char* error_string(int);
int strcoll(const char* a, const char* b)
{
// In the POSIX or C locales strcoll() is equivalent to strcmp().
return strcmp(a, b);
}
char* strerror(int errnum)
{
return const_cast<char*>(error_string(errnum));