forked from Bananymous/banan-os
LibC: Implement setlocale() for C locale
This commit is contained in:
parent
681d8327f5
commit
ca774dfeb5
|
@ -5,7 +5,9 @@ set(LIBC_SOURCES
|
|||
dirent.cpp
|
||||
fcntl.cpp
|
||||
grp.cpp
|
||||
locale.cpp
|
||||
malloc.cpp
|
||||
math.cpp
|
||||
netdb.cpp
|
||||
printf_impl.cpp
|
||||
pwd.cpp
|
||||
|
@ -25,7 +27,6 @@ set(LIBC_SOURCES
|
|||
termios.cpp
|
||||
time.cpp
|
||||
unistd.cpp
|
||||
math.cpp
|
||||
icxxabi.cpp
|
||||
|
||||
../../../BAN/BAN/Assert.cpp
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#include <locale.h>
|
||||
#include <string.h>
|
||||
|
||||
// FIXME: Actually support locales
|
||||
char* setlocale(int category, const char* locale)
|
||||
{
|
||||
(void)category;
|
||||
|
||||
static char s_locale[] = "C";
|
||||
if (locale == nullptr)
|
||||
return s_locale;
|
||||
if (strcmp(locale, "") == 0 || strcmp(locale, "C") == 0 || strcmp(locale, "POSIX") == 0)
|
||||
return s_locale;
|
||||
return nullptr;
|
||||
}
|
Loading…
Reference in New Issue