From a06902baf6ba5fff86bd4d398d7fa77c5a357104 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 14 Jan 2012 16:44:48 +0100 Subject: [PATCH] Added strcoll(3). --- libmaxsi/c/hsrc/string.h | 2 +- libmaxsi/string.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libmaxsi/c/hsrc/string.h b/libmaxsi/c/hsrc/string.h index 57f59502..e6f42903 100644 --- a/libmaxsi/c/hsrc/string.h +++ b/libmaxsi/c/hsrc/string.h @@ -40,6 +40,7 @@ void* memset(void*, int, size_t); char* strcat(char* restrict, const char* restrict); char* strchr(const char*, int); int strcmp(const char*, const char*); +int strcoll(const char*, const char*); size_t strcspn(const char*, const char*); char* strcpy(char* restrict, const char* restrict); char* strerror(int); @@ -56,7 +57,6 @@ void* memccpy(void* restrict, const void* restrict, int, size_t); void* memmove(void*, const void*, size_t); char* stpcpy(char* restrict, const char* restrict); char* stpncpy(char* restrict, const char* restrict, size_t); -int strcoll(const char*, const char*); int strcoll_l(const char*, const char*, locale_t); char* strdup(const char*); char* strerror_l(int, locale_t); diff --git a/libmaxsi/string.cpp b/libmaxsi/string.cpp index 8803b193..84f57683 100644 --- a/libmaxsi/string.cpp +++ b/libmaxsi/string.cpp @@ -211,6 +211,12 @@ namespace Maxsi return (negative) ? -result : result; } + extern "C" int strcoll(const char* s1, const char* s2) + { + // TODO: Pay attention to locales. + return Compare(s1, s2); + } + #if 0 char* Combine(size_t NumParameters, ...) {