Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: a19e3599018195002a8054863cc653a4905971d2 https://github.com/Perl/perl5/commit/a19e3599018195002a8054863cc653a4905971d2 Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023)
Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- locale.c: Change parameter name for static function category_locales_list is somewhat more descriptive than individ_locales Commit: 3338b6d3c28e9558484a214f7b799ef76251618e https://github.com/Perl/perl5/commit/3338b6d3c28e9558484a214f7b799ef76251618e Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Change API of S_calculate_LC_ALL_string This function looks at all the individual locale categories on the system. So far it is called with either an array of the current values for them, or an object from which those values can be derived. But the object is always the current locale object in effect. The querylocale_i() macro can be used to get this information without needing to have to name the object. Therefore the object parameter is superfluous, and the function could be notified to use querylocale_i by making the array parameter NULL. But right now you get one or the other. There are two signatures to this function, depending on the platform capabilities. This commit collapses those into one signature, the one with an array parameter. And then NULL is used to trigger calling querylocale_i(). The reason to do this is that future commits will want to pass an array to this function, even when it is compiled on a platform that currently doesn't allow that option. Commit: 66da06fadedd7dc68258e21e55fc8bb44048a1e4 https://github.com/Perl/perl5/commit/66da06fadedd7dc68258e21e55fc8bb44048a1e4 Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Simplify S_get_LC_ALL_display The previous enhancements to calculate_LC_ALL_string means this function can just call it without having to loop itself. Commit: cd62fc02f25912038813dfdd17bef0ac1a2dcb7d https://github.com/Perl/perl5/commit/cd62fc02f25912038813dfdd17bef0ac1a2dcb7d Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- thread_locale_init: error check, and keep var updated It's best to check the return from libc calls with POSIX 2008 locales, as they don't always operate as expected. And this commit updates a per-thread variable; failure to do this led to some failures in some rare Configurations; in particular those implementing POSIX 2008 but not having strerror_l() included. Commit: d68bbb45e2571927456243c5e7095572a119b59e https://github.com/Perl/perl5/commit/d68bbb45e2571927456243c5e7095572a119b59e Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Slight refactoring of S_querylocale_2008_i This just moves some asserts, adds comments and a branch prediction, and replaces a variable used in only one place by it value. Commit: 4b8cfff8bbfe9d61cb915a0e02d94e6134fbde62 https://github.com/Perl/perl5/commit/4b8cfff8bbfe9d61cb915a0e02d94e6134fbde62 Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Reorder #if clauses Currently, the two clauses are about the same length, but in the next commits the current first clause will become a lot longer. The principal that it's easier to read code that disposes of the easy cases first comes into play, so, reverse the clause order. This commit also puts the entire second clause within a single #ifdef, which will improve readability in future commits. Commit: c7dced5e1104e597c3f6736557401862dbdf9cc5 https://github.com/Perl/perl5/commit/c7dced5e1104e597c3f6736557401862dbdf9cc5 Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Inline only remaining use of querylocale_l() Future commits would make this macro need to be a function anyway, and since there is only one use of it, just inline it. The assertion it defines is no longer needed, as we know that the one place it is now placed is valid. This also adds explanatory comments Commit: 29d1d75a7ee6fc4f9e9239ac5e8e9c6ee7a6755b https://github.com/Perl/perl5/commit/29d1d75a7ee6fc4f9e9239ac5e8e9c6ee7a6755b Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Flatten two nested if's These can be combined into a single more cohesive construct Commit: 0f3830f3997cf7ef1531bad26d2e0f13220dd862 https://github.com/Perl/perl5/commit/0f3830f3997cf7ef1531bad26d2e0f13220dd862 Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Work around some libc POSIX 2008 bugs Some systems try to make C.UTF-8 the same locale as plain C or POSIX. The latter two names are synonymous according to the POSIX Standard, but C.UTF-8 isn't. It might be possible to implement them all with one locale internally, but in some cases, at least, that isn't transparent to us, leading to wrong results. This commit adds a workaround for this problem. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269375 Commit: 88a38b938edb6fb5756bd801f45631b6baafc8e2 https://github.com/Perl/perl5/commit/88a38b938edb6fb5756bd801f45631b6baafc8e2 Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add optional locking around querylocale() The querylocale() libc call on some systems is non-standard, and experience has shown it isn't necessarily thread-safe, especially on Darwin. It does appear to be safe on modern *BSD boxes. This commit adds a locking mechanism that can be set up in a hints file. Commit: 6e519e9de7bb029739e8e904503a31036adea5b0 https://github.com/Perl/perl5/commit/6e519e9de7bb029739e8e904503a31036adea5b0 Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M hints/darwin.sh Log Message: ----------- hints/darwin: querylocale() has a race Make sure querylocale() is executed while a mutex locks out other accesses. Commit: cfc647229808d7335f9ba3e529bafa91c6be7351 https://github.com/Perl/perl5/commit/cfc647229808d7335f9ba3e529bafa91c6be7351 Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move a #define group, and add a comment Commit: 796f4ab0d4d47f96ee05bb143d0e65df62db7337 https://github.com/Perl/perl5/commit/796f4ab0d4d47f96ee05bb143d0e65df62db7337 Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M embed.fnc M embed.h M locale.c M perl.h M proto.h Log Message: ----------- locale.c: Split up S_setlocale_from_aggregate_LC_ALL This splits out the parsing of the LC_ALL string from the locale setting. Future commits will use the parse portion in more places. The new code doesn't panic on syntax errors, unlike the old. This is because we should never panic on user input, but return failure instead. Commit: 052ce90621dc9b9ec3a417381cadaa517f6aaaac https://github.com/Perl/perl5/commit/052ce90621dc9b9ec3a417381cadaa517f6aaaac Author: Karl Williamson <k...@cpan.org> Date: 2023-07-30 (Sun, 30 Jul 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move two helper functions for POSIX 2008 implementation This standardizes the principal that in this file, helper functions come at the end of their section Compare: https://github.com/Perl/perl5/compare/fe7336cf3cc3...052ce90621dc