diff --git a/include/cxx/clocale b/include/cxx/clocale index 39d691e484..154bf8040a 100644 --- a/include/cxx/clocale +++ b/include/cxx/clocale @@ -46,11 +46,10 @@ // Namespace //*************************************************************************** -#ifdef CONFIG_LIBC_LOCALE namespace std { using ::setlocale; + using ::localeconv; } -#endif #endif // __INCLUDE_CXX_CLOCALE diff --git a/include/locale.h b/include/locale.h index 501990dbaa..16923e4a3d 100644 --- a/include/locale.h +++ b/include/locale.h @@ -43,8 +43,6 @@ #include #include -#ifdef CONFIG_LIBC_LOCALE - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -109,5 +107,4 @@ FAR struct lconv *localeconv(void); } #endif -#endif /* CONFIG_LIBC_LOCALE */ #endif /* __INCLUDE_LOCALE_H */ diff --git a/libc/locale/lib_setlocale.c b/libc/locale/lib_setlocale.c index 335eda84e4..fbd621a110 100644 --- a/libc/locale/lib_setlocale.c +++ b/libc/locale/lib_setlocale.c @@ -43,6 +43,7 @@ #include #ifdef CONFIG_LIBC_LOCALE +#include /**************************************************************************** * Public Functions @@ -62,8 +63,8 @@ FAR char *setlocale(int category, FAR const char *locale) { - /* NULL indicates the the locale was not changed */ - return NULL; + return ((strcmp (locale, "POSIX") == 0 || strcmp (locale, "C") == 0 || + strcmp (locale, "") == 0) ? "C" : NULL); } #endif