aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2024-08-22 21:21:51 +0200
committerCorinna Vinschen <corinna@vinschen.de>2024-08-22 21:21:51 +0200
commitd78ca12ab4269abd6684a358b7e6b28ef5d45c2a (patch)
treea4130f4280769dba1e353ae87cf6cd21411618a0
parentea1a458d20d6493f808cf4146dee106e5376ec99 (diff)
downloadnewlib-d78ca12ab4269abd6684a358b7e6b28ef5d45c2a.zip
newlib-d78ca12ab4269abd6684a358b7e6b28ef5d45c2a.tar.gz
newlib-d78ca12ab4269abd6684a358b7e6b28ef5d45c2a.tar.bz2
locales: Fix definition of lc_messages_T::codeset
nl_langinfo_l accesses lc_messages_T::codeset as soon as __HAVE_LOCALE_INFO__ is defined, but codeset only exists if __HAVE_LOCALE_INFO_EXTENDED__ is defined. Fix this by defining lc_messages_T::codeset depending on __HAVE_LOCALE_INFO__. Fixes: ac7f1d5e931c ("Get rid of LCID, reformat type definitions in setlocale.h") Reported-by: Inglis <Brian.Inglis@SystematicSW.ab.ca> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--newlib/libc/locale/setlocale.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/newlib/libc/locale/setlocale.h b/newlib/libc/locale/setlocale.h
index 7abf92f..e91034a 100644
--- a/newlib/libc/locale/setlocale.h
+++ b/newlib/libc/locale/setlocale.h
@@ -162,13 +162,15 @@ struct lc_messages_T
const char *noexpr;
const char *yesstr;
const char *nostr;
-#ifdef __HAVE_LOCALE_INFO_EXTENDED__
+#ifdef __HAVE_LOCALE_INFO__
const char *codeset; /* codeset for mbtowc conversion */
+#ifdef __HAVE_LOCALE_INFO_EXTENDED__
const wchar_t *wyesexpr;
const wchar_t *wnoexpr;
const wchar_t *wyesstr;
const wchar_t *wnostr;
#endif
+#endif
};
extern const struct lc_messages_T _C_messages_locale;