From c73d3e9c5f2a8c0a6a45e33c81b21c98f5dbec39 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 19 Oct 2016 07:06:43 -0600 Subject: [PATCH] Remove comments that no longer apply. clocale should not do anyting if CONFIG_LIBC_LOCALE is not defined. --- include/cxx/clocale | 2 ++ include/locale.h | 1 + include/stddef.h | 2 +- include/wchar.h | 17 ++--------------- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/include/cxx/clocale b/include/cxx/clocale index c99e456567..39d691e484 100644 --- a/include/cxx/clocale +++ b/include/cxx/clocale @@ -46,9 +46,11 @@ // Namespace //*************************************************************************** +#ifdef CONFIG_LIBC_LOCALE namespace std { using ::setlocale; } +#endif #endif // __INCLUDE_CXX_CLOCALE diff --git a/include/locale.h b/include/locale.h index 17501ec700..501990dbaa 100644 --- a/include/locale.h +++ b/include/locale.h @@ -40,6 +40,7 @@ * Included Files ****************************************************************************/ +#include #include #ifdef CONFIG_LIBC_LOCALE diff --git a/include/stddef.h b/include/stddef.h index 2b59c58a3d..63e815daf8 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -80,7 +80,7 @@ * codes for all members of the largest character set specified among the * locales supported by the compilation environment: the null character has * the code value 0 and each member of the portable character set has a - * code value equal to its value when used as the lone character in an\ + * code value equal to its value when used as the lone character in an * integer character constant. * * size_t diff --git a/include/wchar.h b/include/wchar.h index 582cec4683..805521fa2c 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -102,6 +102,8 @@ typedef int wint_t; * A scalar type of a data object that can hold values which represent * locale-specific character classification. * + * Ddefined in wctype.h. Should be defined here. + * * mbstate_t * An object type other than an array type that can hold the conversion * state information necessary to convert between sequences of (possibly @@ -110,21 +112,6 @@ typedef int wint_t; * state, the results are unspecified. */ -/* Commented out because this is dangerous. This defines a type that would - * be internal to some wchar implementation. NuttX does not implement the - * wchar functions. Having this definition is a time bomb: If this header - * file is inadvertently included in code that interacts with an external - * library and if the definition of mbstate_t does not EXACTLY match the - * usage in that external library, then a potentially fatal error could - * occur. - * - * It is better to let the build error out due to the lack of the mbstate_t - * definition. At least that way, the problem can be avoided and the user - * can come up with some alternative way of dealing with the interfacing - * issue that does not require NuttX to be in lock-step with some external - * implementation. - */ - struct mbstate_s { int __fill[6];