POSIX-1.2008 per-thread locales, groundwork part 1

Introduce first cut of struct _thr_locale_t used for the locale_t definition.
Introduce global instance called __global_locale used by default.
Introduce internal inline functions __get_global_locale, __get_locale_r,
__get_current_locale.

Remove usage of global variables in favor of accessor functions pointing to
__global_locale for now.  Include all local headers in locale subdir from
setlocale.h to get single include for internal locale access.

Introduce __CTYPE_PTR macro to replace direct access to __ctype_ptr__
and use throughout in isxxx functions.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2016-07-13 16:51:33 +02:00
parent 51b669f679
commit a6a477fa81
31 changed files with 610 additions and 484 deletions

View File

@ -63,9 +63,8 @@ __FBSDID("$FreeBSD: src/lib/libc/regex/regcomp.c,v 1.36 2007/06/11 03:05:54 delp
#include "cname.h"
#ifdef __CYGWIN__
/* These are defined in nlsfuncs.cc. */
extern LCID collate_lcid;
extern char collate_charset[];
/* Defined in nlsfuncs.cc. */
extern LCID __get_current_collate_lcid ();
#endif
/*
@ -832,7 +831,7 @@ p_b_term(struct parse *p, cset *cs)
CHadd(p, cs, start);
else {
#ifdef __CYGWIN__
if (!collate_lcid) {
if (!__get_current_collate_lcid ()) {
#else
if (__collate_load_error) {
#endif