X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Flocale%2Fnewlocale.c;h=d20a8489835f54e26fb4a59ffcb419b5da43f4bf;hb=9443f1b5cfeba687f45b96572378519e81ff9a56;hp=8fb006a7fcdb934ec7031942f5fa1cb6eda6888c;hpb=5ce3737931bb411a8d167356d4d0287b53b0cbdc;p=musl diff --git a/src/locale/newlocale.c b/src/locale/newlocale.c index 8fb006a7..d20a8489 100644 --- a/src/locale/newlocale.c +++ b/src/locale/newlocale.c @@ -1,45 +1,55 @@ #include #include +#include #include "locale_impl.h" +static pthread_once_t default_locale_once; +static struct __locale_struct default_locale, default_ctype_locale; + +static void default_locale_init(void) +{ + for (int i=0; icat[i] : + __get_locale(i, (mask & (1<cat[i] = __get_locale(i, name); + *loc = tmp; return loc; } - /* Otherwise, build a temporary locale object, which will only - * be instantiated in allocated storage if it does not match - * one of the built-in static locales. This makes the common - * usage case for newlocale, getting a C locale with predictable - * behavior, very fast, and more importantly, fail-safe. */ - for (j=i=0; icat[i]; - else - lm = __get_locale(i, mask & (1<