From bfff8b1becd7d01c074177df7196ab327cd8c844 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sun, 1 Jan 2017 00:14:16 +0000 Subject: Update copyright dates with scripts/update-copyrights. --- locale/xlocale.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'locale/xlocale.h') diff --git a/locale/xlocale.h b/locale/xlocale.h index e4408e2e99..20b2c1109f 100644 --- a/locale/xlocale.h +++ b/locale/xlocale.h @@ -1,5 +1,5 @@ /* Definition of locale datatype. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. -- cgit v1.2.3 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. --- ChangeLog | 29 ++++++++++++++++++++++ NEWS | 4 +++ ctype/ctype.h | 16 ++---------- dev/null | 0 include/bits/types/__locale_t.h | 1 + include/bits/types/locale_t.h | 1 + include/printf.h | 2 +- include/time.h | 2 +- include/xlocale.h | 1 - locale/Makefile | 3 ++- locale/bits/types/__locale_t.h | 44 +++++++++++++++++++++++++++++++++ locale/bits/types/locale_t.h | 26 +++++++++++++++++++ locale/langinfo.h | 7 ++---- locale/locale.h | 20 ++++++--------- locale/xlocale.h | 44 --------------------------------- stdlib/monetary.h | 3 ++- stdlib/stdlib.h | 22 ++++------------- stdlib/strtod_l.c | 3 +-- stdlib/strtof_l.c | 2 +- stdlib/strtol_l.c | 1 - stdlib/strtold_l.c | 6 +---- stdlib/strtoll_l.c | 2 +- stdlib/strtoul_l.c | 2 +- stdlib/strtoull_l.c | 2 +- string/string.h | 3 ++- string/strings.h | 3 ++- sysdeps/ieee754/ldbl-128ibm/strtold_l.c | 1 - sysdeps/ieee754/ldbl-64-128/strtold_l.c | 1 - time/time.h | 2 +- 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 +- wctype/wctype.h | 4 +-- 37 files changed, 152 insertions(+), 144 deletions(-) create mode 100644 dev/null create mode 100644 include/bits/types/__locale_t.h create mode 100644 include/bits/types/locale_t.h delete mode 100644 include/xlocale.h create mode 100644 locale/bits/types/__locale_t.h create mode 100644 locale/bits/types/locale_t.h delete mode 100644 locale/xlocale.h (limited to 'locale/xlocale.h') diff --git a/ChangeLog b/ChangeLog index 84f177d2a5..c7877ef1bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2017-06-20 Zack Weinberg + + * 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. + 2017-06-20 Adhemerval Zanella * sysdeps/unix/sysv/linux/openat.c (__libc_openat): Build only diff --git a/NEWS b/NEWS index 4db334b687..0736b4b27f 100644 --- a/NEWS +++ b/NEWS @@ -74,6 +74,10 @@ Version 2.26 as this kind of optimization is better done by the compiler. The macros __USE_STRING_INLINES and __NO_STRING_INLINES no longer have any effect. +* The nonstandard header has been removed. Most programs should + use instead. If you have a specific need for the definition + of locale_t with no other declarations, please talk to us. + * The reallocarray function has been added to libc. It is a realloc replacement with a check for integer overflow when calculating total allocation size. diff --git a/ctype/ctype.h b/ctype/ctype.h index 1fe89cf836..ce598d53e5 100644 --- a/ctype/ctype.h +++ b/ctype/ctype.h @@ -233,20 +233,8 @@ __NTH (toupper (int __c)) #ifdef __USE_XOPEN2K8 -/* 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 +/* POSIX.1-2008 extended locale interface (see locale.h). */ +# include /* These definitions are similar to the ones above but all functions take as an argument a handle for the locale which shall be used. */ diff --git a/dev/null b/dev/null new file mode 100644 index 0000000000..e69de29bb2 diff --git a/include/bits/types/__locale_t.h b/include/bits/types/__locale_t.h new file mode 100644 index 0000000000..610b8197c7 --- /dev/null +++ b/include/bits/types/__locale_t.h @@ -0,0 +1 @@ +#include diff --git a/include/bits/types/locale_t.h b/include/bits/types/locale_t.h new file mode 100644 index 0000000000..24b074872f --- /dev/null +++ b/include/bits/types/locale_t.h @@ -0,0 +1 @@ +#include diff --git a/include/printf.h b/include/printf.h index 984f263167..7b4d209c47 100644 --- a/include/printf.h +++ b/include/printf.h @@ -4,7 +4,7 @@ # ifndef _ISOMAC -#include +#include /* Now define the internal interfaces. */ extern int __printf_fphex (FILE *, const struct printf_info *, diff --git a/include/time.h b/include/time.h index 3a828e0420..0a67cf3a19 100644 --- a/include/time.h +++ b/include/time.h @@ -2,7 +2,7 @@ #include