POSIX-1.2008 per-thread locales, groundwork part 2

Move all locale category structure definitions into setlocale.h and remove
other headers in locale subdir.  Create inline accessor functions for
current category struct pointers and use throughout.  Use pointers to
"C" locale category structs by default in __global_locale.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2016-07-19 16:48:07 +02:00
parent a6a477fa81
commit 88208d3735
20 changed files with 275 additions and 480 deletions

View File

@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD: src/lib/libc/regex/regcomp.c,v 1.36 2007/06/11 03:05:54 delp
#ifdef __CYGWIN__
#include "winsup.h"
#include "../locale/setlocale.h"
#endif
#include <sys/types.h>
#include <stdio.h>
@@ -62,11 +63,6 @@ __FBSDID("$FreeBSD: src/lib/libc/regex/regcomp.c,v 1.36 2007/06/11 03:05:54 delp
#include "cname.h"
#ifdef __CYGWIN__
/* Defined in nlsfuncs.cc. */
extern LCID __get_current_collate_lcid ();
#endif
/*
* parse structure, passed up and down to avoid global variables and
* other clumsinesses
@@ -831,7 +827,7 @@ p_b_term(struct parse *p, cset *cs)
CHadd(p, cs, start);
else {
#ifdef __CYGWIN__
if (!__get_current_collate_lcid ()) {
if (!__get_current_collate_locale ()->lcid) {
#else
if (__collate_load_error) {
#endif