Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/locale/freelocale.c')
-rw-r--r--newlib/libc/locale/freelocale.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/newlib/libc/locale/freelocale.c b/newlib/libc/locale/freelocale.c
index eba439e7d..dd3c0f95e 100644
--- a/newlib/libc/locale/freelocale.c
+++ b/newlib/libc/locale/freelocale.c
@@ -40,8 +40,10 @@ PORTABILITY
void
_freelocale_r (struct _reent *p, struct __locale_t *locobj)
{
+ /* Nothing to do on !_MB_CAPABLE targets. */
+#ifdef _MB_CAPABLE
/* Sanity check. The "C" locale is static, don't try to free it. */
- if (!locobj || locobj == &__C_locale || locobj == LC_GLOBAL_LOCALE)
+ if (!locobj || locobj == __get_C_locale () || locobj == LC_GLOBAL_LOCALE)
return;
#ifdef __HAVE_LOCALE_INFO__
for (int i = 1; i < _LC_LAST; ++i)
@@ -52,6 +54,7 @@ _freelocale_r (struct _reent *p, struct __locale_t *locobj)
}
#endif /* __HAVE_LOCALE_INFO__ */
_free_r (p, locobj);
+#endif /* _MB_CAPABLE */
}
void