about summary refs log tree commit diff
path: root/src/locale/newlocale.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-06-06 18:53:02 +0000
committerRich Felker <dalias@aerifal.cx>2015-06-06 18:53:02 +0000
commit16bf466532d7328e971012b0731ad493b017ad29 (patch)
tree706444d26d8f70089aadbab6a1e6bfd1711ee00a /src/locale/newlocale.c
parent312eea2ea4f4363fb01b73660c08bfcf43dd3bb4 (diff)
downloadmusl-16bf466532d7328e971012b0731ad493b017ad29.tar.gz
musl-16bf466532d7328e971012b0731ad493b017ad29.tar.xz
musl-16bf466532d7328e971012b0731ad493b017ad29.zip
make static C and C.UTF-8 locales available outside of newlocale
Diffstat (limited to 'src/locale/newlocale.c')
-rw-r--r--src/locale/newlocale.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/locale/newlocale.c b/src/locale/newlocale.c
index 89d36b1d..f50bbe91 100644
--- a/src/locale/newlocale.c
+++ b/src/locale/newlocale.c
@@ -3,16 +3,9 @@
 #include "locale_impl.h"
 #include "libc.h"
 
-extern const struct __locale_map __c_dot_utf8;
-
-static const struct __locale_struct c_locale = { 0 };
-static const struct __locale_struct c_dot_utf8_locale = {
-	.cat[LC_CTYPE] = &__c_dot_utf8
-};
-
 int __loc_is_allocated(locale_t loc)
 {
-	return loc && loc != &c_locale && loc != &c_dot_utf8_locale;
+	return loc && loc != C_LOCALE && loc != UTF8_LOCALE;
 }
 
 locale_t __newlocale(int mask, const char *name, locale_t loc)
@@ -44,9 +37,9 @@ locale_t __newlocale(int mask, const char *name, locale_t loc)
 	}
 
 	if (!j)
-		return (locale_t)&c_locale;
-	if (j==1 && tmp.cat[LC_CTYPE]==c_dot_utf8_locale.cat[LC_CTYPE])
-		return (locale_t)&c_dot_utf8_locale;
+		return C_LOCALE;
+	if (j==1 && tmp.cat[LC_CTYPE]==&__c_dot_utf8)
+		return UTF8_LOCALE;
 
 	if ((loc = malloc(sizeof *loc))) *loc = tmp;