From f0be25b6336db7492e47d2e8e72eb8af53b5506d Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 9 Jun 2017 12:02:06 -0400 Subject: Rename xlocale.h to bits/types/__locale_t.h. xlocale.h is already a single-type micro-header, defining struct __locale_struct and the typedefs __locale_t and locale_t. This patch brings it into the bits/types/ scheme: there are now bits/types/__locale_t.h which defines only __locale_struct and __locale_t, and bits/types/locale_t.h which defines locale_t as well as the other two. None of *our* headers need __locale_t.h, but it appears to me that libstdc++ could make use of it. There are a lot of external uses of xlocale.h, but all the uses I checked had an autoconf test or equivalent for its existence. It has never been available from other C libraries, and it has always contained a comment reading "This file is not standardized, don't rely on it, it can go away without warning" so I think dropping it is pretty safe. I also took the opportunity to clean up comments in various public header files that still talk about the *_l interfaces as though they were completely nonstandard. There are a few of them, notably the strtoX_l and wcstoX_l families, that haven't been standardized, but the bulk are in POSIX.1-2008. * locale/xlocale.h: Rename to... * locale/bits/types/__locale_t.h: ...here. Adjust commentary. Only define struct __locale_struct and __locale_t, not locale_t. * locale/bits/types/locale_t.h: New file; define locale_t here. * locale/Makefile (headers): Update to match. * include/xlocale.h: Delete wrapper. * include/bits/types/__locale_t.h: New wrapper. * include/bits/types/locale_t.h: New wrapper. * ctype/ctype.h, include/printf.h, include/time.h * locale/langinfo.h, locale/locale.h, stdlib/monetary.h * stdlib/stdlib.h, string/string.h, string/strings.h, time/time.h * wcsmbs/wchar.h, wctype/wctype.h: Use bits/types/locale_t.h. Correct outdated comments regarding the standardization status of the functions that take locale_t arguments. * stdlib/strtod_l.c, stdlib/strtof_l.c, stdlib/strtol_l.c * stdlib/strtold_l.c, stdlib/strtoul_l.c, stdlib/strtoull_l.c * sysdeps/ieee754/ldbl-128ibm/strtold_l.c * sysdeps/ieee754/ldbl-64-128/strtold_l.c * wcsmbs/wcstod.c, wcsmbs/wcstod_l.c, wcsmbs/wcstof.c * wcsmbs/wcstof_l.c, wcsmbs/wcstold.c, wcsmbs/wcstold_l.c: Don't include xlocale.h. If necessary, include locale.h instead. * stdlib/strtold_l.c: Unconditionally include wchar.h. --- wcsmbs/wchar.h | 27 ++++++--------------------- wcsmbs/wcstod.c | 2 +- wcsmbs/wcstod_l.c | 2 +- wcsmbs/wcstof.c | 2 +- wcsmbs/wcstof_l.c | 2 +- wcsmbs/wcstold.c | 2 +- wcsmbs/wcstold_l.c | 2 +- 7 files changed, 12 insertions(+), 27 deletions(-) (limited to 'wcsmbs') diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index accd24a..9054661 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -45,6 +45,9 @@ #if defined __USE_UNIX98 || defined __USE_XOPEN2K # include #endif +#ifdef __USE_XOPEN2K8 +# include +#endif /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && __GNUC_PREREQ (4, 4) @@ -116,8 +119,6 @@ extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2, /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ -# include - extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; @@ -435,23 +436,9 @@ extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr, #endif /* Use GNU. */ #ifdef __USE_GNU -/* The concept of one static locale per category is not very well - thought out. Many applications will need to process its data using - information from several different locales. Another application is - the implementation of the internationalization handling in the - upcoming ISO C++ standard library. To support this another set of - the functions using locale data exist which have an additional - argument. - - Attention: all these functions are *not* standardized in any form. - This is a proof-of-concept implementation. */ - -/* Structure for reentrant locale using functions. This is an - (almost) opaque type for the user level programs. */ -# include - -/* Special versions of the functions above which take the locale to - use as an additional parameter. */ +/* Parallel versions of the functions above which take the locale to + use as an additional parameter. These are GNU extensions inspired + by the POSIX.1-2008 extended locale API. */ extern long int wcstol_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; @@ -783,8 +770,6 @@ extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, const struct tm *__restrict __tp) __THROW; # ifdef __USE_GNU -# include - /* Similar to `wcsftime' but takes the information from the provided locale and not the global locale. */ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, diff --git a/wcsmbs/wcstod.c b/wcsmbs/wcstod.c index b7db11b..72fa7ea 100644 --- a/wcsmbs/wcstod.c +++ b/wcsmbs/wcstod.c @@ -17,7 +17,7 @@ . */ #include -#include +#include #define USE_WIDE_CHAR 1 diff --git a/wcsmbs/wcstod_l.c b/wcsmbs/wcstod_l.c index 5f7498c..1d5c67c 100644 --- a/wcsmbs/wcstod_l.c +++ b/wcsmbs/wcstod_l.c @@ -18,7 +18,7 @@ . */ #include -#include +#include extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int, diff --git a/wcsmbs/wcstof.c b/wcsmbs/wcstof.c index 29cdec3..67c16e0 100644 --- a/wcsmbs/wcstof.c +++ b/wcsmbs/wcstof.c @@ -17,7 +17,7 @@ . */ #include -#include +#include #define USE_WIDE_CHAR 1 diff --git a/wcsmbs/wcstof_l.c b/wcsmbs/wcstof_l.c index 23d402d..d430bf1 100644 --- a/wcsmbs/wcstof_l.c +++ b/wcsmbs/wcstof_l.c @@ -18,7 +18,7 @@ . */ #include -#include +#include #define USE_WIDE_CHAR 1 diff --git a/wcsmbs/wcstold.c b/wcsmbs/wcstold.c index e5c1cc3..816f43b 100644 --- a/wcsmbs/wcstold.c +++ b/wcsmbs/wcstold.c @@ -17,7 +17,7 @@ . */ #include -#include +#include #define USE_WIDE_CHAR 1 diff --git a/wcsmbs/wcstold_l.c b/wcsmbs/wcstold_l.c index 3dd33a7..86f63e8 100644 --- a/wcsmbs/wcstold_l.c +++ b/wcsmbs/wcstold_l.c @@ -18,7 +18,7 @@ . */ #include -#include +#include #define USE_WIDE_CHAR 1 -- cgit v1.1