diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-07-13 16:51:33 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-08-15 10:56:56 +0200 |
commit | a6a477fa8190b13d4ef0150875e2bd114cb5b132 (patch) | |
tree | 0a4902cd997922c684b4ad4488f31eb2bde66f22 /newlib/libc/include/locale.h | |
parent | 51b669f679119556a12798096794845cd1049d95 (diff) | |
download | cygnal-a6a477fa8190b13d4ef0150875e2bd114cb5b132.tar.gz cygnal-a6a477fa8190b13d4ef0150875e2bd114cb5b132.tar.bz2 cygnal-a6a477fa8190b13d4ef0150875e2bd114cb5b132.zip |
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>
Diffstat (limited to 'newlib/libc/include/locale.h')
-rw-r--r-- | newlib/libc/include/locale.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/newlib/libc/include/locale.h b/newlib/libc/include/locale.h index cbd658e41..c7bfd5996 100644 --- a/newlib/libc/include/locale.h +++ b/newlib/libc/include/locale.h @@ -20,6 +20,21 @@ #define LC_TIME 5 #define LC_MESSAGES 6 +#if __POSIX_VISIBLE >= 200809 +#define LC_ALL_MASK (1 << LC_ALL) +#define LC_COLLATE_MASK (1 << LC_COLLATE) +#define LC_CTYPE_MASK (1 << LC_CTYPE) +#define LC_MONETARY_MASK (1 << LC_MONETARY) +#define LC_NUMERIC_MASK (1 << LC_NUMERIC) +#define LC_TIME_MASK (1 << LC_TIME) +#define LC_MESSAGES_MASK (1 << LC_MESSAGES) + +#define LC_GLOBAL_LOCALE ((struct _thr_locale_t *) -1) + +struct _thr_locale_t; +typedef struct _thr_locale_t *locale_t; +#endif + _BEGIN_STD_C struct lconv |