diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-07-21 20:49:42 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-08-15 10:56:57 +0200 |
commit | 1498c79db89ea0e02a49ffa34e71da480e37165e (patch) | |
tree | bda74f7fab50ac2ab0e8262a91865e1e6a8c03c2 /winsup | |
parent | d16a56306d63b4d94412b479a8ea83463a3514ab (diff) | |
download | newlib-1498c79db89ea0e02a49ffa34e71da480e37165e.zip newlib-1498c79db89ea0e02a49ffa34e71da480e37165e.tar.gz newlib-1498c79db89ea0e02a49ffa34e71da480e37165e.tar.bz2 |
Change loadlocale to fill a __locale_t given as parameter
Don't use global variables. This allows to call loadlocale from
the yet to be created newlocale().
Rename _thr_locale_t to __locale_t (these locales are not restricted
to threads so the name is misleading).
Along these lines, fix _set_ctype to take a __locale_t as parameter.
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ctype.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/nlsfuncs.cc | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/ctype.cc b/winsup/cygwin/ctype.cc index 94de81e..a7dc18a 100644 --- a/winsup/cygwin/ctype.cc +++ b/winsup/cygwin/ctype.cc @@ -19,7 +19,7 @@ extern const char __ctype_cp[22][128 + 256]; /* Newlib */ extern const char __ctype_iso[15][128 + 256]; /* Newlib */ void -__set_ctype (struct _reent *reent, const char *charset) +__set_ctype (struct __locale_t *loc, const char *charset) { int idx; char *ctype_ptr = NULL; @@ -63,8 +63,8 @@ __set_ctype (struct _reent *reent, const char *charset) } ctype_ptr = (char *) _ctype_b; } - if (reent) - __get_locale_r (reent)->ctype_ptr = ctype_ptr + 127; + if (loc) + loc->ctype_ptr = ctype_ptr + 127; else __ctype_ptr__ = ctype_ptr + 127; } diff --git a/winsup/cygwin/nlsfuncs.cc b/winsup/cygwin/nlsfuncs.cc index 2ba9f32..021af44 100644 --- a/winsup/cygwin/nlsfuncs.cc +++ b/winsup/cygwin/nlsfuncs.cc @@ -1070,7 +1070,7 @@ __set_lc_messages_from_win (const char *name, LC_COLLATE locale information. This is subsequently accessed by the below functions strcoll, strxfrm, wcscoll, wcsxfrm. */ extern "C" int -__collate_load_locale (struct _thr_locale_t *locale, const char *name, +__collate_load_locale (struct __locale_t *locale, const char *name, void *f_mbtowc, const char *charset) { const struct lc_collate_T *ccop; |