Branch: refs/heads/smoke-me/khw-locale
Home: https://github.com/Perl/perl5
Commit: cd9fa4b2aa76688f6ad93679a1d16bf82a7a8597
https://github.com/Perl/perl5/commit/cd9fa4b2aa76688f6ad93679a1d16bf82a7a8597
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M dosish.h
M unixish.h
Log Message:
-----------
XXX craig Unixish.h, doshish.h: Reorder terminations; simplify
The IO and memory terminations need to be after other things. Add a
comment so that future maintainers won't make the mistakes I did.
Also refactor to that amiga os doesn't have a separate list to get out
of sync
I suspect that the amiga termination should be moved to earlier in
the sequence, but absent any evidence; I'm leaving it unchanged.
Commit: af3e0f2b83d8e0bbbe385318a5026069d98e423b
https://github.com/Perl/perl5/commit/af3e0f2b83d8e0bbbe385318a5026069d98e423b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Win32: Don't check folds validity
This code will check, when warnings are on, that the libc functions
return valid values. But Windows platforms will always fail because
they have multiple divergences from the Posix standard. The macros that
implement the case changing/folding in handy.h take extra steps to bring
Windows code more into alignment with Posix. Those are too complicated
to easily duplicate the logic here. The result of these checks is
looked at by our test suite, which has long, without anyone noticing,
skipped portions on Windows, even though handy.h should correct for
this. So simply, don't do the checking under Windows, and find out what
handy.h has failed to fully correct for.
Commit: fd0bde48e6ac832e89e83d0597f727ca2d75651f
https://github.com/Perl/perl5/commit/fd0bde48e6ac832e89e83d0597f727ca2d75651f
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M lib/locale_threads.t
Log Message:
-----------
XXX locale_threads
Commit: 0816e105b557ce30365691564fc85ceb830af72f
https://github.com/Perl/perl5/commit/0816e105b557ce30365691564fc85ceb830af72f
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
DEBUG_L now also looks at environment variable
Because locale initialization happens before command line processing,
one can't pass a -DL argument to enable debugging of locale
initialization. Instead, an environment variable is read then, and is
used to enable debugging or not. In the past, code specifically had to
test for this being set. This commit changes that so that debugging can
automatically be enabled without having to write special code. Future
commits will strip out those special checks.
Commit: d6709e18f9be7260613453f803f91b8ce91812fc
https://github.com/Perl/perl5/commit/d6709e18f9be7260613453f803f91b8ce91812fc
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Replace most #ifdef DEBUGGING lines
THe previous commit enhanced the DEBUG macros so that they contain the
logic that previously had to be done with conditional compilation
statements. Removing them makes the code easier to read.
Commit: b0b2f5b6e372d091bb875c030d473b62e2f55c60
https://github.com/Perl/perl5/commit/b0b2f5b6e372d091bb875c030d473b62e2f55c60
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
M numeric.c
M regcomp.c
M regexec.c
M utfebcdic.h
Log Message:
-----------
Change handy.h macro names to be C standard conformant
C reserves symbols beginning with underscores for its own use. This
commit moves the underscore so it is trailing, which is legal. The
symbols changed here are most of the ones in handy.h that have few uses
outside it.
Commit: cafb3f769c4e2b096110d3aae7ceba7c8bfa933b
https://github.com/Perl/perl5/commit/cafb3f769c4e2b096110d3aae7ceba7c8bfa933b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Remove only 2 calls to an internal macro
Replace isIDFIRST_LC and isWORD_CHAR_LC isIDFIRST_LC with slightly
faster implementations.
Commit: 8a12d6025e30b9417afd3afe71d85db5829345c8
https://github.com/Perl/perl5/commit/8a12d6025e30b9417afd3afe71d85db5829345c8
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Refactor some #ifdef's for commonality
This changes these compilation conditionals so that things in common
between Windows and other platforms are only defined once.
It changes the isIDFIRST_LC and isWORDCHAR_LC definitions for
non-Windows to match that platform superficially, though expanding to
what it previously did to.
Commit: 0533dfcff669edd1364cd11fbb82356e4853fadf
https://github.com/Perl/perl5/commit/0533dfcff669edd1364cd11fbb82356e4853fadf
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Add some branch predictions
Commit: 933fc1c391e0dd65638cfaacdc0caf697049055b
https://github.com/Perl/perl5/commit/933fc1c391e0dd65638cfaacdc0caf697049055b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: White-space, comment only
Commit: a4e190a6f1476b81bb6f7eab6e246b56d0ce7a25
https://github.com/Perl/perl5/commit/a4e190a6f1476b81bb6f7eab6e246b56d0ce7a25
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Don't use char class if no LC_CTYPE
It is possible to compile perl to not pay attention to LC_CTYPE. This
was testing for no locales at all; whereas the stricter requirement
should be used.
Commit: 62eaa8d0103eacfeeb1a33c208eb0afa9f542c45
https://github.com/Perl/perl5/commit/62eaa8d0103eacfeeb1a33c208eb0afa9f542c45
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M charclass_invlists.h
M handy.h
M l1_char_class_tab.h
M lib/unicore/uni_keywords.pl
M perl.c
M perl.h
M regcomp.c
M regcomp.h
M regen/mk_PL_charclass.pl
M regexec.c
M sv.c
M uni_keywords.h
M utfebcdic.h
Log Message:
-----------
Change handy.h macro names to be C standard conformant
C reserves symbols beginning with underscores for its own use. This
commit moves the underscore so it is trailing, which is legal. The
symbols changed here are many of the ones in handy.h that have
significant uses outside it.
Commit: fb6ee1910b6a2e060aa69e1d58ded3164859976a
https://github.com/Perl/perl5/commit/fb6ee1910b6a2e060aa69e1d58ded3164859976a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Rmv internal macro
LC_CAST_ was my attempt at generality, but I didn't realize that the
POSIX standard specifies the type that this was meant to generalize, so
there isn't any need for it.
Commit: 70841ab54919960f7eea8dee62d17fefafedbf2e
https://github.com/Perl/perl5/commit/70841ab54919960f7eea8dee62d17fefafedbf2e
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Refactor some internal macros
This changes the parameters etc, in preparation for further changes
Commit: 397bf5578f5212a0b497ca393a7c627d82aa5bee
https://github.com/Perl/perl5/commit/397bf5578f5212a0b497ca393a7c627d82aa5bee
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Rmv unnecessary parameter to internal macros
The cast is required to be U8 by the POSIX standard. There is no need
to have this added generality.
Commit: 88a0dfb803f726dfcb0f60c51b1e3803b3fb3046
https://github.com/Perl/perl5/commit/88a0dfb803f726dfcb0f60c51b1e3803b3fb3046
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: #define one macro in terms of another
These two macros are equivalent as folding and lowercasing are the same
for this input domain. Better to say so rather than to replicate the
definitions.
Commit: 41f30f98a708b50aa64c29d8a1e977449b8b3636
https://github.com/Perl/perl5/commit/41f30f98a708b50aa64c29d8a1e977449b8b3636
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
No locales => don't use isspace(), toLower() etc.
This commit changes what happens on platforms without locale handling to
use our precomputed definitions of what the various character class
definitions and case changing operations are. Previously, it just
called the libc locale-dependent functions and made sure the result was
ASCII. I think this is a holdover from before we had the precomputed
definitions
Commit: 703d361ab2f87a242df6973dc1578282009c156e
https://github.com/Perl/perl5/commit/703d361ab2f87a242df6973dc1578282009c156e
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Collapse two sets of macros
By redefining a wrapper macro used in one set based on compile-time
info; the other set can be defined in terms of it, and the separate
entries removed.
Commit: b906c844a80053acb49e2e2f6e57eba5e4da3b91
https://github.com/Perl/perl5/commit/b906c844a80053acb49e2e2f6e57eba5e4da3b91
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Move some macro defns around
This is to make the difference listing in future commits smaller.
This change includes some comment changes, and some extra parens around
some subexpressions
Commit: 5a132e760dd748ae0f0e1830709f1d7bb1441a3e
https://github.com/Perl/perl5/commit/5a132e760dd748ae0f0e1830709f1d7bb1441a3e
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Collapse some macros
These 3 sets of macros can be collapsed trivially into 3 macros.
Commit: bf921f1f5116c76e0845ff4345360aa85566362f
https://github.com/Perl/perl5/commit/bf921f1f5116c76e0845ff4345360aa85566362f
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Add wrapper layer macros for isalnum() ...
This adds a new set of macros, forming a lower layer to what is currently
there to wrap the character classification libc functions, isdigit()
etc, and case changing ones, tolower(), toupper().
On most platforms these expand simply to the libc function call. But on
windows, they expand to something more complex, to bring the Windows
calls into POSIX compliance. Previously that was achieved at the higher
level, with the result that lower level calls were broken. This
resulted in parts of the test suite being skipped on Windows.
The current level is rewritten to use the new lower layer, with the
result that it is simpler, as the complexity is now done further down.
I thought about calling these macros is_porcelain_isalnum or something
similar to emphaisze that they are close to the bare libc version, but
thought isU8_alnum() is shorter and conveys another truth, that being
the input is assumed to be a byte, without checking.
Commit: 5db95af70c0e0c978055b168dfa0dc40d3f527f5
https://github.com/Perl/perl5/commit/5db95af70c0e0c978055b168dfa0dc40d3f527f5
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M vms/vms.c
Log Message:
-----------
locale.c: Use new macros from the prev commit
This should result in Windows boxes now passing the locale sanity
checks. Previously that failure would cause the test suite tests to be
skipped, and warnings generated to Windows users that actually were
invalid, as the flaws were actually compensated for in other code.
Commit: 3f3d6d1d7a75387e9ea0e42fdc543b4e69994e41
https://github.com/Perl/perl5/commit/3f3d6d1d7a75387e9ea0e42fdc543b4e69994e41
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
XXX SEE IF WORKS handy.h: Change Windows macros
Commit: bd02b0ed8d012bf19efc6d6d89b543b818df37b7
https://github.com/Perl/perl5/commit/bd02b0ed8d012bf19efc6d6d89b543b818df37b7
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Add isCASED_LC
As a convenience to other code.
Commit: de01b5c8393f4344253f2c41a5744a29ba3a1ca7
https://github.com/Perl/perl5/commit/de01b5c8393f4344253f2c41a5744a29ba3a1ca7
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M regexec.c
Log Message:
-----------
regexec.c: Improve code
These case statements in a switch all had the same prelude for checking
if the locale is UTF-8 and handling that case separately. A few commits
ago created macros closer to the base level. This commit factors out
the common UTF-8 handling, and then puts the lower lever things in the
switch(). Perhaps the C optimizer will be smart enough to do this too,
but we might as well do it ourselves, now that it is convenient.
Commit: 2aeb537098dc93cabb5f4112f99f98a573cc8e83
https://github.com/Perl/perl5/commit/2aeb537098dc93cabb5f4112f99f98a573cc8e83
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M regexec.c
Log Message:
-----------
regexec.c: Refactor switch default()
It seems clearer to me to have the panic at the end of the routine
instead of as the default: of a switch().
Commit: f3cee82f0dd0899649b08d98227c6f35c79a97ec
https://github.com/Perl/perl5/commit/f3cee82f0dd0899649b08d98227c6f35c79a97ec
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Declare three static arrays to be so.
Commit: 4dc4275241becb9b3ddeb1f50ae9365ea25353a9
https://github.com/Perl/perl5/commit/4dc4275241becb9b3ddeb1f50ae9365ea25353a9
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
Move some locale.c #defines to perl.h
This is in preparation for them to be used in macros from outside
locale.c
Commit: ad69099c5e16c3187eecfad712f9979b9168aabd
https://github.com/Perl/perl5/commit/ad69099c5e16c3187eecfad712f9979b9168aabd
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
Mark newly moved symbols as private
The previous commit made certain symbols that previously were local to
locale.c now available everywhere. Add a trailing underscore to their
names to mark them as private.
Commit: 8d49696c4c0ddbda825861937bcc91455f786f51
https://github.com/Perl/perl5/commit/8d49696c4c0ddbda825861937bcc91455f786f51
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M makedef.pl
M perl.h
Log Message:
-----------
Add USE_LOCALE_THREADS #define
This is in preparation for supporting configurations where there threads
are available, but the locale handling code should ignore that fact.
This stems from the unusual locale handling of z/OS, where any attempt
is ignored to change locales after the first thread is created.
Commit: 14e3dde9455abbea0820fa76dc080edac30284f8
https://github.com/Perl/perl5/commit/14e3dde9455abbea0820fa76dc080edac30284f8
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M ext/POSIX/POSIX.xs
M ext/POSIX/lib/POSIX.pm
M intrpvar.h
M locale.c
M makedef.pl
M perl.c
M perl.h
M sv.c
Log Message:
-----------
Regularize HAS_POSIX_2008_LOCALE, USE_POSIX_2008_LOCALE
A platform shouldn't be required to use the Posix 2008 locale handling
functions if they are present. Perhaps they are buggy. So, a separate
define for using them was introduced, USE_POSIX_2008_LOCALE. But until
this commit there were cases that were looking at the underlying
availability of the functions, not if the Configuration called for their
use.
Commit: c440ae82f659d0282b7ca8e0e75ef90214da76eb
https://github.com/Perl/perl5/commit/c440ae82f659d0282b7ca8e0e75ef90214da76eb
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Change macro name
Adopt the git convention of 'porcelain' meaning without special
handling. This makes it clear that porcelain_setlocale() is the base
level.
Commit: 9dfd13d185fdecb98e409d557fa725b842aa0622
https://github.com/Perl/perl5/commit/9dfd13d185fdecb98e409d557fa725b842aa0622
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Cast return of setlocale() to const
If they had it to do over again, the libc makers would have made the
return of this function 'const char *'. We can cast it that way
internally to catch erroneous uses at compile time.
Commit: 83b9939638859a2873b63730c3d36119fc514e3a
https://github.com/Perl/perl5/commit/83b9939638859a2873b63730c3d36119fc514e3a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Create S_get_category_index()
libc locale categories, like LC_NUMERIC, are opaque integers. This
makes it inconvenient to have table-driven code. Instead, we have
tables that are indexed by small positive integers, which are a
compile-time mapping from the libc values.
This commit creates a run-time function to also do that mapping. It
will first be used in the next commit.
The function does a loop through the available categories, looking for a
match. It could be replaced by some sort of quick hash lookup, but the
largest arrays in the field have a max of 12 elements, with almost all
searches finding their quarry in the first 6. It doesn't seem
worthwhile to me to replace a linear search of 6 elements by something
more complicated. The design intent is this search will be used only at
the edges of the locale-handling code; once found the index is used in
future bits of the current operation.
Commit: bd00b91d2f1dfa4cafa7c5a7c74a858b2957d0b9
https://github.com/Perl/perl5/commit/bd00b91d2f1dfa4cafa7c5a7c74a858b2957d0b9
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Use get_category_index()
This creates the first uses of the function added in the previous commit.
It changes the name of a function that now takes an index to have the
suffix _i to indicate its calling parameter is a category index rather
than a category. This will become a common paradigm in this file in
later commits.
Two macros are also created to call that function; they have suffixes _c
(to indicate the parameter is a category known at compile time, and _r
(to indicate it needs to be computed at runtime). This is in keeping
with the already existing paradigm in this file.
Commit: bdf0d265cc36bf14ba3db764bf6351cfd2a32a33
https://github.com/Perl/perl5/commit/bdf0d265cc36bf14ba3db764bf6351cfd2a32a33
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Change S_emulate_setlocale name and sig
It turns out this function is called only from places where we have the
category index already computed; so change the signature to use the
index and remove the re-calculation.
It renames it to emulate_setlocale_i() to indicate that the category
parameter is an index.
This also means, that it's very unlikely that it will be called with an
out-of-bounds value. Remove the debugging statement for that case (but
retain the error return value).
Commit: acbf3f041dd0856470f272dfb09da859a59f887b
https://github.com/Perl/perl5/commit/acbf3f041dd0856470f272dfb09da859a59f887b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M pod/perldelta.pod
M pod/perldiag.pod
Log Message:
-----------
locale.c: Simplify S_category_name
We can use the new function S_get_category_index() to simplify this.
Also, when I wrote it I didn't know about Perl_form(), and had
reimplemented a portion of it here; which is yanked as well.
Commit: 0ddc041b6c00f4804d52bc6b39323109c3ea9148
https://github.com/Perl/perl5/commit/0ddc041b6c00f4804d52bc6b39323109c3ea9148
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Move unreachable code
It turns out this code, setting errno, is unreachable. Move it to the
place where it would do some good, removing an extraneous, unreachable
return;
Commit: 324abcbc4bce69f2d90a9e8077bac6d3ab262f95
https://github.com/Perl/perl5/commit/324abcbc4bce69f2d90a9e8077bac6d3ab262f95
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Comment clarifications, white space
Some of these are to make future difference listings shorter
Some of the changes look like incorrect indentation here, but anticipate
future commits.
Commit: a05aa14d183aa417e3aa6f935834a44393e5864b
https://github.com/Perl/perl5/commit/a05aa14d183aa417e3aa6f935834a44393e5864b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Move fcn within file
This is for later commits which will change it to rely on new defines
that won't occur until later in the file than its current position
Commit: 381785f29adf3197d31b9fbbd2ab18f188cccea8
https://github.com/Perl/perl5/commit/381785f29adf3197d31b9fbbd2ab18f188cccea8
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Separate query part of emulate_setlocale()
This splits a large function so that it is easier to comprehend, and is
in preparation for them to be separately callable.
Commit: 331c187618bc2acc1a4eb4844691d918a7ceb067
https://github.com/Perl/perl5/commit/331c187618bc2acc1a4eb4844691d918a7ceb067
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Outdent previous commit
The previous commit kept the indentation level the same as it moved code
to a new function, even though an outer block was stripped off in the
process. This was to minimize diff output. This commit is white space
only.
Commit: ab8d3091b94f7e842a0096ba1da53195b227abf5
https://github.com/Perl/perl5/commit/ab8d3091b94f7e842a0096ba1da53195b227abf5
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Remove spaces around a '##' preprocessor directive
It turns out that at least my gcc preprocessor gets confused in some
contexts if spaces surround the ##. CAT2() doesn't work for these.
It is working in this context, but future commits will introduce ones
where it won't, so this commit will help make things consistent within
this file
What seems to fail is #define f(x) (..., g(x ## y), ...) where 'x' is a
an already #defined symbol. I want 'xy', but instead, for example if
'x' has been defined to be 1, I get '1y'
Commit: 278a7ce75fc656b53eb002ada95ead8efca928aa
https://github.com/Perl/perl5/commit/278a7ce75fc656b53eb002ada95ead8efca928aa
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: #define some macros in terms of a base one
This is so changes to the lowest level automatically propagate to the
others
Commit: ca4ac3716105971386d3842c4d3a5e881993b1c9
https://github.com/Perl/perl5/commit/ca4ac3716105971386d3842c4d3a5e881993b1c9
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Create new macros for just querying locale
There are two sets of names, which immediately indicate if the result
can be relied on to be thread level or must be assumed to be global to
the whole process. At the moment they all expand to the same thing,
since on a threadless perl, it's a don't care; and on a threaded perl,
they are all already thread-level, in the Configurations we support.
Future commits will cause the macros to diverge, and comments will be
added then.
For POSIX 2008, this commit causes queries to go directly to the query
function, avoiding S_emulate_setlocale_i() completely.
Commit: e064fe53b43c7dfa136a7599d7c957031c8f8021
https://github.com/Perl/perl5/commit/e064fe53b43c7dfa136a7599d7c957031c8f8021
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Generalize certain Win32 calls
The old versions were windows-specific; the changes use a more generic
macro that currently expands to the same thing, but future commits will
change that.
Commit: 2c9c3abcd8898025026f9954d6c8e3ad819ca52f
https://github.com/Perl/perl5/commit/2c9c3abcd8898025026f9954d6c8e3ad819ca52f
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add a convenience #define
This makes it clear if we are using an array that currently only happens
on non-querylocale systems, but that will change in future commits.
Commit: fad409d4e5326a6ca581f965ef687ce074a94145
https://github.com/Perl/perl5/commit/fad409d4e5326a6ca581f965ef687ce074a94145
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add setlocale() return context macros
Future commits will benefit from knowing if the return value of
setlocale is to be ignored, just checked for if it worked, or the full
value is needed and can be relied on (or not) to be per-thread.
Commit: 72ba1668df24860c8a3fbb414a115efe163b2f84
https://github.com/Perl/perl5/commit/72ba1668df24860c8a3fbb414a115efe163b2f84
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add panic check/message
This panic is done when a setlocale unexpectedly fails.
Commit: f1fd9af511a1b74cace789b503d081c0aa3e8f89
https://github.com/Perl/perl5/commit/f1fd9af511a1b74cace789b503d081c0aa3e8f89
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Use a function table to simplify code
Some locale categories require extra steps when they are changed. This
moves that logic to a table, which gets rid of some code
Commit: 9a31f558e49e5af73723fbec67bdb5d93cc355e0
https://github.com/Perl/perl5/commit/9a31f558e49e5af73723fbec67bdb5d93cc355e0
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
Perl_setlocale(): Same code for all param2 == NULL
Calling Perl_setlocale() with a NULL 2nd parameter returns the current
locale, rather than changing it. Previously LC_NUMERIC and LC_ALL were
treated specially; other categories were lumped in with the code that
changes the locale.
Changing some categories involves a non-trivial amount of work. This
commit avoids that by moving all queries to the same 'if' branch.
LC_NUMERIC and LC_ALL still have to be treated specially, but now it's
all within the same outer 'if', and the unnecessarily executing code
for when the locale changes is avoided.
Commit: 2ee58e5d9bcdb7c51f9393103eb916cc2d5e5ed8
https://github.com/Perl/perl5/commit/2ee58e5d9bcdb7c51f9393103eb916cc2d5e5ed8
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use low level macros at low level
Implementing Perl_setlocale, we can safely use the internal macros that
the public ones expand to call, without the overhead those public macros
impose (which they do to be more immune from improper calls from outside
code).
Commit: fa219fc1f18b283cb5ae76840b3c8b6b7e6fd81c
https://github.com/Perl/perl5/commit/fa219fc1f18b283cb5ae76840b3c8b6b7e6fd81c
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Remove exploratory code
This code was to find out, in debugging builds, if an undocumented glibc
feature worked. There were no reports that it didn't, and so, after,
several releases, it has served its purpose. A future commit will allow
enabling this feature as a Configuration option.
Commit: b42f9c1c8f96ca099f7306c7f0b5b134ecab2615
https://github.com/Perl/perl5/commit/b42f9c1c8f96ca099f7306c7f0b5b134ecab2615
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
perl.h: Expand scope of cpp conditional
This just doesn't bother with checking some locale-related stuff if not
paying attention to locales.
Commit: 7fc4f8bed6127bcdbadeef7a6d81aae77e658953
https://github.com/Perl/perl5/commit/7fc4f8bed6127bcdbadeef7a6d81aae77e658953
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
locale.c: Create new convenience macro
glibc doesn't have the querylocale() function, available on some other
platforms, such as Darwin and *BSD. However, it instead has the
equivalent functionality available through an undocumented feature.
This commit allows someone in the know to compile perl to use that
feature, and wraps its API with a macro so that the calling code doesn't
have to be aware of the different APIs of the two methods.
That macro's definition is now done in perl.h, as future commits will
use it in other files.
Since this is an undocumented feature, I am not currently documenting
this wrapper availability. However, it has been used in the field
without complaint for a couple of releases, as follows: A more
cumbersome substitute method continues to be used to get what it does.
But in the past both methods were tried and the program died if they
yielded different results. Since no one has complained, I'm fairly
confident it works. But sill I'm deferring its more general use.
Commit: 4ed3bba8c2d28c28cd2dd75068336f5f8fc23d04
https://github.com/Perl/perl5/commit/4ed3bba8c2d28c28cd2dd75068336f5f8fc23d04
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M intrpvar.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: querylocale() doesn't work on LC_ALL
I had misread the man pages. This bug has been in the field for several
releases now, but most likely hasn't shown up because it's almost always
the case that the locale categories will be set to the same locale. And
so most implementations of querylocale() would return the correct
result.
This commit works by splitting the calculation of the value of LC_ALL
from S_emulate_setlocale_i() into a separate function, and extending it
to work on querylocale() systems. This has the added benefit of
removing tangential code from the main line, making
S_emulate_setlocale_i easier to read.
calculate_LC_ALL() is the new function, and is now called from two
places. As part of this commit, constness is added to PL_curlocales[]
Part of this change is to keep our records of LC_ALL on non-querylocale
systems always up-to-date, which is better practice
And part of this change is temporary, marked as such, to be removed a
few commits later.
Commit: e63afbd70eae60a73b31940dead632690f24884f
https://github.com/Perl/perl5/commit/e63afbd70eae60a73b31940dead632690f24884f
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M intrpvar.h
M locale.c
M proto.h
Log Message:
-----------
Make three locale PL_ strings const char*
This adds some compile safety to these.
Commit: e1019c670a78babb5178df45640aa79e5b546717
https://github.com/Perl/perl5/commit/e1019c670a78babb5178df45640aa79e5b546717
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Generalize stdsize_locale()
This function is rewritten to handle LC_ALL, and to handle certain buggy
Win32 locale names. This commit also calls it in appropriate places
where those buggy names could be returned.
setlocale() on Windows may return a locale that cannot be used as input
to a future setlocale(). This is contrary to the C89 standard, and
appears to have been an oversight corrected in the most recent Windows
version(s).
This commit solves the problem (as far as I know) by looking for the
problematic syntax and adjusting it.
I also rewrote the function to handle LC_ALL, which fixes that deficiency.
And, a change in that that I think is an improvement is that everything
starting with a \n is trimmed, instead of just a trailing \n being
chomped.
Commit: 2ba3957fcdccb475fe6ba0094ea3badf5a791e92
https://github.com/Perl/perl5/commit/2ba3957fcdccb475fe6ba0094ea3badf5a791e92
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
XXX drop stdize_locale: #if 0, enabled even for emulate
Commit: dfbc3c7e79ee492e91f63ad72d7cf8f53c68b8a1
https://github.com/Perl/perl5/commit/dfbc3c7e79ee492e91f63ad72d7cf8f53c68b8a1
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
XXX debug stdized
Commit: ad4b77e98d84b9e2d7722c4d78f20808dc6a4f95
https://github.com/Perl/perl5/commit/ad4b77e98d84b9e2d7722c4d78f20808dc6a4f95
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Refactor some derived #defines
The _c suffix is supposed to mean the category is known at compile time.
In some configurations this does not matter, and so I had named things
carelessly, so this might be confusing. This commit fixes that.
Commit: bc2fd72bc178a7e0a74c253c5ffdb416211a0f95
https://github.com/Perl/perl5/commit/bc2fd72bc178a7e0a74c253c5ffdb416211a0f95
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use setlocale() for init, not P2008
We have found bugs in the POSIX 2008 libc implementations on various
platforms. This code, which does the initialization of locale handling
has always been very conservative, expecting possible failures due to
bugs in it our the libc implementations, and backing out if necessary to
a crippled, but workable state, if something goes wrong.
I think we should use the oldest, most stable locale implementation in
these circumstances
Commit: e830564423b76be27874f866b0096c014d4d6c0a
https://github.com/Perl/perl5/commit/e830564423b76be27874f866b0096c014d4d6c0a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Split aggregate LC_ALL from emulate_setlocale
This splits into a separate function the code necessary in some
Configurations to calculate LC_ALL from a potentially disparate
aggregate of categories having different locales.
This is being done just for readability, as this extensive code in the
middle of something else distracts from the main point.
A goto is hence replaced by a recursive call.
Commit: 60c0b70592430b205c0f67cb6b3fe17f3060197d
https://github.com/Perl/perl5/commit/60c0b70592430b205c0f67cb6b3fe17f3060197d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
locale.c: Change internal variable name
The new name better reflects its purpose, so is less confusing
Commit: 6bccb1dbffdf100e6b2121a6c68534ee09fb6aea
https://github.com/Perl/perl5/commit/6bccb1dbffdf100e6b2121a6c68534ee09fb6aea
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Clean up handling of a glibc bug
This commit moves all mention of this bug to just the code that requires
it, and inlines a macro, making it easier to comprehend
Commit: 300d7909f1996e51dc0489761399d04e525f4f4d
https://github.com/Perl/perl5/commit/300d7909f1996e51dc0489761399d04e525f4f4d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Split ancillary from S_emulate_setlocale
This takes the code to update LC_ALL, used only in some Configurations,
out of the main line, making the main line more readable.
It also allows the removal of temporary code added a few commits back
Commit: ad2b12ae036ac5a472dba96ff82659abd68ccfac
https://github.com/Perl/perl5/commit/ad2b12ae036ac5a472dba96ff82659abd68ccfac
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: locale "" can be disparate
Setting a locale "" means to get the value from environment variables.
These can set locale categories to different locales, and this needs to
be handled. The logic before this commit only handled the disparate
case when the locale wasn't ""; but this was compensated for elsewhere.
A future commit will remove that compensation.
Commit: cb27294160a06a4223303b6952481cf559555213
https://github.com/Perl/perl5/commit/cb27294160a06a4223303b6952481cf559555213
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
Split off setting locale to "" from S_emulate_setlocale
This is done for readability, to move the special casing of setting a
locale to the empty string (hence getting it from the environment) out
of the main line code.
Commit: ca496cd591febff58d8d86df706ddd978b581e12
https://github.com/Perl/perl5/commit/ca496cd591febff58d8d86df706ddd978b581e12
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M sv.c
Log Message:
-----------
sv.c: Duplicate more variables during cloning
These locale-related ones should be getting initialized in the new
thread, but be certain.
Commit: f7ae22c9ac3eda02f7d8133fd08c5cec09cf4f9a
https://github.com/Perl/perl5/commit/f7ae22c9ac3eda02f7d8133fd08c5cec09cf4f9a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M embedvar.h
M intrpvar.h
M locale.c
M makedef.pl
M perl.c
M proto.h
M sv.c
Log Message:
-----------
locale.c: Add fcn to hide edge case undefined behavior
The POSIX 2008 API has an edge case in that the result of most of the
functions when called with a global (as opposed to a per-thread) locale
is undefined.
The duplocale() function is the exception which will create a per-thread
locale containing the values copied from the global one.
This commit just calls duplocale, if needed, and the caller need not
concern itself with this possibility
Commit: 790644c0ca4ab2bfe2549fa2038b1968171dd340
https://github.com/Perl/perl5/commit/790644c0ca4ab2bfe2549fa2038b1968171dd340
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add DEBUGGING information
These functions are called as expansions of macros. It may be useful to
know where in the file the macro occurred.
Commit: 89a575d6546ca0a41e1eb7f3160f34554d64eec8
https://github.com/Perl/perl5/commit/89a575d6546ca0a41e1eb7f3160f34554d64eec8
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Separate out two Win fcns from a larger one
This makes the larger one easier to understand, and prepares for
possible independent calls to the two, which are potentially useful on
their own.
Commit: abac0203e7c16e5440b794dd9f820ce227d35ccd
https://github.com/Perl/perl5/commit/abac0203e7c16e5440b794dd9f820ce227d35ccd
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M ext/POSIX/POSIX.xs
Log Message:
-----------
POSIX.xs: Use macro to reduce complexity
This #defines a macro and uses it to populate a structure, so that
strings don't have to be typed twice.
Commit: c6a5517900dc93d52c74f941c93dd2eb1312f157
https://github.com/Perl/perl5/commit/c6a5517900dc93d52c74f941c93dd2eb1312f157
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M ext/POSIX/POSIX.xs
Log Message:
-----------
POSIX.xs: White-space only
Properly indent some nested preprocessor directives
Commit: 459c2d3e72bc6e954195f820e2b0485945a45b3e
https://github.com/Perl/perl5/commit/459c2d3e72bc6e954195f820e2b0485945a45b3e
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M ext/POSIX/POSIX.xs
M locale.c
M proto.h
Log Message:
-----------
Move code from POSIX.xs to locale.c
This avoids duplicated logic.
Commit: 472cc4fa5fc059652d88c59671036cdffa50f950
https://github.com/Perl/perl5/commit/472cc4fa5fc059652d88c59671036cdffa50f950
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Reorder cases in a switch
This moves handling the CODESET to the end, as future commits will make
its handling more complicated. The cases are now ordered so the
simplest (based on the direction of future commits) are first
Commit: c82f9a672d32bf12a7d22c3b2ed58a5778814ede
https://github.com/Perl/perl5/commit/c82f9a672d32bf12a7d22c3b2ed58a5778814ede
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Make statics of repeated string constants
These strings are (or soon will be) used in multiple places; so have
just one definition for them.
Commit: bf1e96a949748b761e5dd500be1cb3054430e0e6
https://github.com/Perl/perl5/commit/bf1e96a949748b761e5dd500be1cb3054430e0e6
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add two #defines
This makes sure that we handle having any variant of nl_langinfo() or
localeconv().
Commit: 87eccb2472adf2b2e1056fc89c8d359d6668a193
https://github.com/Perl/perl5/commit/87eccb2472adf2b2e1056fc89c8d359d6668a193
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Return defaults for uncomputable langinfo items
Return the values from the C locale for nl_langinfo() items that aren't
computable on this platform. If the platform has nl_langinfo(), then
all of them are computable, but if not, some can't be computed, and
others can be, but only if there are alternative methods available on
the platform.
As part of this commit, S_my_nl_langinfo() and S_save_to_buffer() are no
longer used when USE_LOCALE is not defined, so don't compile them.
Commit: 52ea560b3c70b48c9c2c7467b653f065ebe23da5
https://github.com/Perl/perl5/commit/52ea560b3c70b48c9c2c7467b653f065ebe23da5
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Rmv reimplementation of my_strftime()
Prior to this commit, there was a near duplicate copy of the code from
util.c that implements my_strftime(). This was done because the util.c
version zaps the wday field, which made it incompatible.
But it dawned on me that if the arbitrary date we use to do our
calculations were such that it was for a year in which January 1 falls
on a Sunday, then the util.c version automatically works.
Commit: 535cfa69c5da223b1608ad70f1e6258703b0f267
https://github.com/Perl/perl5/commit/535cfa69c5da223b1608ad70f1e6258703b0f267
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Shorten static function name
The extra syllable(s) are unnecessary noise
Commit: 4a6294cea3d72439c0c1f5c494da48b8b144d4c4
https://github.com/Perl/perl5/commit/4a6294cea3d72439c0c1f5c494da48b8b144d4c4
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
locale.c: Extend a static function
This will allow it to be used in situations where the buffer it controls
is single use, and we don't need to keep track of the size for future
calls.
Commit: c626a69438d843e1b1eda210def08a61455190b4
https://github.com/Perl/perl5/commit/c626a69438d843e1b1eda210def08a61455190b4
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use typedef to simplify
This allows some preprocessor conditionals to be removed
Commit: 3eca1797d59e72f87701b890c923f5a713272939
https://github.com/Perl/perl5/commit/3eca1797d59e72f87701b890c923f5a713272939
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Rmv redundant cBOOL()
strEQ and && already return booleans
Commit: 80940eda6b2ba679cac4482b98dd7e18269b1369
https://github.com/Perl/perl5/commit/80940eda6b2ba679cac4482b98dd7e18269b1369
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Fix currency symbol derivation
On platforms without nl_langinfo(), we derive the currency symbol from
localeconv(). The symbol must be tweaked to conform to nl_langinfo()
standards. Prior to this commit, it guessed at how to tweak a rare
circumstance. I found evidence this guess was wrong, so looked around,
and copied the way cygwin does it.
This also no longer returns just an empty string in certain cases.
nl_langinfo() itself doesn't, so conform to that.
Commit: 9a202a1297ab385a173477f416c0e2d314f26084
https://github.com/Perl/perl5/commit/9a202a1297ab385a173477f416c0e2d314f26084
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Don't add CP to Windows code page names
The actual name appears to be just the number for purposes of
nl_langinfo()-ish things.
Commit: b9733f5e5445f2825d7a076bfbbb6e6e24a23346
https://github.com/Perl/perl5/commit/b9733f5e5445f2825d7a076bfbbb6e6e24a23346
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
locale.c: Don't ask a static fcn to be inlined
It's too complicated to really be inlined, and the compiler can figure
things out itself given it is a static function
Commit: ba1691b8853c7051a6358c958def17cfd2637852
https://github.com/Perl/perl5/commit/ba1691b8853c7051a6358c958def17cfd2637852
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
locale.c: Rmv no longer used param from static fnc
Previous commits have gotten rid of this parameter to S_save_to_buffer
Commit: 3fb6d96755860a031221a00e9c53311f258b25b4
https://github.com/Perl/perl5/commit/3fb6d96755860a031221a00e9c53311f258b25b4
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Don't change locale if already there
Changing the locale is cheap for some categories, but expensive for
others. Changing LC_COLLATE is most expensive, requiring recalculation
of the collation transformation mapping.
This commit checks that we aren't already in the desired locale before
changing locales. and does nothing if no change is needed.
Commit: b2f89c3ce4f660f2ce326943bf1dde878603386d
https://github.com/Perl/perl5/commit/b2f89c3ce4f660f2ce326943bf1dde878603386d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use a scratch buf; instead of reusing old
This is in preparation for the next commit
Commit: 1d6f48e3e3cbc5341f4022567557e4ddc32a2962
https://github.com/Perl/perl5/commit/1d6f48e3e3cbc5341f4022567557e4ddc32a2962
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Make static fcn reentrant
This makes my_langinfo() reentrant by adding parameters specifying where
to store the result.
This prepares for future commits, and fixes some minor bugs for XS
writers, in that the claim was that the buffer in calling
Perl_langinfo() was safe from getting zapped until the next call to it
in the same thread. It turns out there were cases where, because of
internal calls, the buffer did get zapped.
Commit: a3f07994475e4c2377b25bf91ef682af895d7e40
https://github.com/Perl/perl5/commit/a3f07994475e4c2377b25bf91ef682af895d7e40
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: langinfo: Use Windows fcn to find CODESET
There is a Windows function, available for quite a long time, that will
return the current code page. Use this for the nl_langinfo() CODESET,
as that libc function isn't implemented on Windows.
Commit: 34665b15ebe9cdefca01a83f230b651adf157e95
https://github.com/Perl/perl5/commit/34665b15ebe9cdefca01a83f230b651adf157e95
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add static fcn to analyze locale codeset
It determines if the name indicates it is UTF-8 or not. There are
several variant spellings in use, and this hides that from the the
callers.
It won't be actually used until the next commit
Commit: fd7c1ee829a0bda64eaa6ffc260ef416078f799c
https://github.com/Perl/perl5/commit/fd7c1ee829a0bda64eaa6ffc260ef416078f799c
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M ext/I18N-Langinfo/Langinfo.pm
M locale.c
Log Message:
-----------
locale.c: Improve non-nl_langinfo() CODESET calc
Prior to this commit, on non-Windows platforms that don't have a
nl_langinfo() libc function, the code completely punted computation of
the CODESET item. I have not been able to figure out how to do this,
even going to the locale definition files on disk (which may vary
anyway), but we can do a lot better than punting.
This commit adds three checks:
1) If the locale name is C or POSIX, we know the codeset
2) We can detect if a locale is UTF-8. If it is, that is the codeset.
Many modern locales are of this ilk.
3) Failing that, some locales have the codeset appear in the name,
following a dot.
It isn't perfect, but it's a lot better than completely punting.
Commit: 7a39b31e738560b9696b84e81bc3ab12eaa083b3
https://github.com/Perl/perl5/commit/7a39b31e738560b9696b84e81bc3ab12eaa083b3
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
New signature for static fcn my_langinfo()
This commit changes the calling sequence for my_langinfo to add the
desired locale (or a sentinel to indicate to use the current locale),
and the locale category of the desired item.
This allows the function to be able to return the desired value for any
locale, avoiding some locale changes that would happen until this
commit, and hiding the need for locale changes from outside functions,
though a couple continue to do so to avoid potential multiple changes.
Commit: 7faad9e025210a6211c9760e46787f0593b9b1da
https://github.com/Perl/perl5/commit/7faad9e025210a6211c9760e46787f0593b9b1da
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add is_locale_utf8()
Previous commits have added the infrastructure to be able to determine
if a locale is UTF-8. This will prove useful, and this commit adds
a function to encapsulate this information, and uses it in a couple of
places, with more to come in future commits.
This uses as a final fallback, mbtowc(), which some sources view was a
late adder to C89, and others as not really being available until C99.
Future commits will add heuristics when that function isn't available.
Commit: 90ceb381c5be59a7b4e8868f9d140b5c58d61dee
https://github.com/Perl/perl5/commit/90ceb381c5be59a7b4e8868f9d140b5c58d61dee
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add fcn for UTF8ness determination
get_locale_string_utf8ness_i() will determine if the string it is passed
in the locale it is passed is to be treated as UTF-8, or not.
Commit: e513147000007fc04032f1d02a5ae9b0f5a70000
https://github.com/Perl/perl5/commit/e513147000007fc04032f1d02a5ae9b0f5a70000
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M ext/POSIX/POSIX.xs
M locale.c
M proto.h
Log Message:
-----------
XXX perldelta Move POSIX::localeconv() logic to locale.c
The code currently in POSIX.xs is moved to locale.c, and reworked some
to fit in that scheme, and the logic for the workaround for the Windows
broken localeconv() is made more robust.
This is in preparation for the next commit which will use this logic
instead of (imperfectly) duplicating it.
This also creates Perl_localeconv() for direct XS calls of this
functionality.
Commit: c5146f3454c03d9d9dd9771479034306cbfa3770
https://github.com/Perl/perl5/commit/c5146f3454c03d9d9dd9771479034306cbfa3770
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Collapse duplicate logic into one instance
The previous commit move the logic for localeconv() into locale.c. This
commit takes advantage of that to use it instead of repeating the logic.
On Windows, there is alternative way of finding the radix character for
systems that have a localeconv() that could cause a race. Prior to this
commit, if that failed to find something that looked like the radix, it
returned a '?'. Now it will drop down to using this new code, as the
likelihood of the race is small.
Notably, this commit removes the inconsistent duplicate logic that had
been used to deal with the Windows broken localeconv() bug.
Commit: bece99f84e0683ed47945d8767938fb218d10408
https://github.com/Perl/perl5/commit/bece99f84e0683ed47945d8767938fb218d10408
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Fix windows bug with broken localeconv()
localeconv() was broken on Windows until VS 2015. As a workaround, this
was using my_snprintf() to find what the decimal point character is,
trying to avoid our workaround for localeconv(), which has a (slight)
chance of a race condition.
The problem is that my_snprintf() might not end up calling snprintf at
all; I didn't trace all possibilities in Windows. So it doesn't make
for a reliable sentinel.
This commit now specifically uses libc snprintf(), and if it fails, drops
down to try localeconv().
Commit: fc64c83b95602191061f01b760ada46b52750799
https://github.com/Perl/perl5/commit/fc64c83b95602191061f01b760ada46b52750799
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M ext/POSIX/POSIX.xs
M locale.c
M proto.h
Log Message:
-----------
XXXdelta Add my_strftime8()
This is like plain my_strftime(), but additionally returns an indication
of the UTF-8ness of the returned string
Commit: fa2a49d877d1e4952a4e45930ebe5465d2be17be
https://github.com/Perl/perl5/commit/fa2a49d877d1e4952a4e45930ebe5465d2be17be
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add utf8ness return param to static fcn
my_langinfo_i() now will additionally return the UTF-8ness of the
returned string.
Commit: 0644d845c3abd1596db277db43f302eae2c6006a
https://github.com/Perl/perl5/commit/0644d845c3abd1596db277db43f302eae2c6006a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M ext/I18N-Langinfo/Langinfo.xs
M locale.c
M proto.h
Log Message:
-----------
XXXdelta Add Perl_langinfo8()
This is like Perl_langinfo() but additionally returns information about
the UTF-8ness of the returned string.
Commit: 60199ea95a72fe0bed7a820984825baa3288d97b
https://github.com/Perl/perl5/commit/60199ea95a72fe0bed7a820984825baa3288d97b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add fallbacks if no mbtowc()
This add heuristics that work well for non-English locales to determine
if a locale is UTF-8 or not when mbtowc() isn't available. It would be
a very rare compiler that didn't have that these days, but this covers
that case as best as I have been able to figure out.
Commit: 2f89f0d23cd798af59e49ece4567a6f2a8cf7264
https://github.com/Perl/perl5/commit/2f89f0d23cd798af59e49ece4567a6f2a8cf7264
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use Strerror(), not strerror()
Commit: 3e3ced6e3d39d0ca4e687fd9f0a3362bfded21fd
https://github.com/Perl/perl5/commit/3e3ced6e3d39d0ca4e687fd9f0a3362bfded21fd
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Refactor #ifdef's for clarity
The my_strerror() function has effectively 5 different implementations
depending on the capabilities of the platform. Only a few lines are
common to all, the set-up and the return. The #ifdefs obscure the
underlying logic. So this commit separates them out into 5 different
functions, with the result that it's clear what is going on in each.
Commit: f2f9af09587641b48df0200307acbf67d8b2de1d
https://github.com/Perl/perl5/commit/f2f9af09587641b48df0200307acbf67d8b2de1d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
Avoid mojibake in "$!"
In stress testing, I discovered that the LC_CTYPE and LC_MESSAGES
locales need to be the same locale, or strerror() can return
question marks or mojibake instead of the proper message.
This commit refactors the handling of stringifying "$!" to make the
locales of both categories the same during the stringification.
Actually, I suspect it isn't the locale, but the codeset of the locale
that needs to be the same. I suspect that if the categories were both
in different UTF-8 locales, or both in single-byte locales, that things
would work fine. But it's cheaper to find the locale rather than the
locale's codeset, so that is what is done.
Commit: b925ef4b21ced884301aa643aa050542dbc69a55
https://github.com/Perl/perl5/commit/b925ef4b21ced884301aa643aa050542dbc69a55
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M makedef.pl
M mg.c
M proto.h
Log Message:
-----------
Move utf8ness calc for $! into locale.c from mg.c
locale.c has the infrastructure to handle this, so remove repeated
logic.
The removed code tried to discern better based on using script runs, but
this actually doesn't help, so is removed.
Commit: b93e7dddcc2c94cd6207681510fcfeaaca7bfb05
https://github.com/Perl/perl5/commit/b93e7dddcc2c94cd6207681510fcfeaaca7bfb05
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M mg.c
Log Message:
-----------
mg.c: White-space only
Indent newly formed block from the previous commit.
Commit: 951d6885b5e811176d12872ee9c39f5d78a0a62d
https://github.com/Perl/perl5/commit/951d6885b5e811176d12872ee9c39f5d78a0a62d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M embedvar.h
M intrpvar.h
M locale.c
M proto.h
M sv.c
Log Message:
-----------
locale.c: Rmv no longer used code; UTF8ness cache
What these functions do has been subsumed by code introduced in previous
commits, and in a more straight forward manner.
Also removed in this commit is the cache of the knowing what locales are
UTF-8 or not. This data is now cheaper to calculate when needed, and
there is now a single entry cache, so I don't think the complexity
warrants keeping it.
It could be added back if necessary, split off from the remainder of
this commit.
Commit: cf5924d6fababd9c3dbb70eef71d3f232d0b1a18
https://github.com/Perl/perl5/commit/cf5924d6fababd9c3dbb70eef71d3f232d0b1a18
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
Don't discard locale info in starting P2008
The program is started in the global locale, and then is converted to
the POSIX 2008 per-thread locale API. Prior to this commit the startup
locale was discarded. It really should be the foundation for the 2008
locales. I don't know of any current paths through the code that this
makes a difference for, but it is a potential hole that is easy to plug.
Commit: fac535dda6ee4ef3d23da49c2b66d20d8957cfbc
https://github.com/Perl/perl5/commit/fac535dda6ee4ef3d23da49c2b66d20d8957cfbc
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M perl.h
M proto.h
Log Message:
-----------
Add a common locale panic macro and functions
This will make sure that all the necessary clean up gets done.
Commit: 63257feb6c885b186ba16142278117b2a6800bc2
https://github.com/Perl/perl5/commit/63257feb6c885b186ba16142278117b2a6800bc2
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Revamp sync_locale()
This rarely used function was actually failing to do what it purported
in some Configurations.
Commit: 581430dee5f7f5d7860f4a7ff8aadbc48e2be817
https://github.com/Perl/perl5/commit/581430dee5f7f5d7860f4a7ff8aadbc48e2be817
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Clean up thread_locale_init()
We can use internal functions to this file instead of the API ones here.
This commit also calls sync_locale() to avoid repeated logic.
Commit: aaf71d39651b3750e97e9576d5d45147852af251
https://github.com/Perl/perl5/commit/aaf71d39651b3750e97e9576d5d45147852af251
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
Revamp switch_to_global_locale()
Prior to this commit, the global locale was not always getting populated
with the values from the thread being switched.
Commit: 2906798a1d10f49c0615e19b0be018ddad14a0df
https://github.com/Perl/perl5/commit/2906798a1d10f49c0615e19b0be018ddad14a0df
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Omit an extra copy
In this case in Perl_setlocale(), we can just return the plain result
from setlocale(), as, if something further needs to be done that would
destroy it, that is taken care of already at the time.
On per-thread locale platforms, the result already is in a per-category
buffer.
Commit: 51b1e76c4275a12ecea1e9a32783e906c7303b47
https://github.com/Perl/perl5/commit/51b1e76c4275a12ecea1e9a32783e906c7303b47
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embedvar.h
M intrpvar.h
M locale.c
M makedef.pl
M perl.c
M sv.c
Log Message:
-----------
locale.c: Cache the current LC_CTYPE locale name
This is now used as a cache of length 1 to avoid having to lookup up the
UTF-8ness as often.
There was a complicated cache previously, but changes to the logic
caused that to be much less necessary, and it is no longer actually
used, and will be removed in a later commit.
But it's pretty easy to keep this single value around to cut further
down the new scheme's need to look it up
Commit: ee0d135c38f08a7aae3f410e968c8a3e2fd7fe61
https://github.com/Perl/perl5/commit/ee0d135c38f08a7aae3f410e968c8a3e2fd7fe61
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M intrpvar.h
Log Message:
-----------
intrpvar.h: Initialize a variable
I don't believe there is a bug with this PL_numeric_name being
uninitialized, but this is an easy precaution.
Commit: 9e00f65a7640750691cab9039cbac1cf0a9fe922
https://github.com/Perl/perl5/commit/9e00f65a7640750691cab9039cbac1cf0a9fe922
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
Swap the ordering of two locale category indices
Perl internally uses a mapping of locale category values into a
consecutive sequence of indices starting at 0. These are used as
indexes into arrays. The reason is that the category numbers are
opaque, vary by platform, aren't necessarily sequential, and hence are
hard to make table driven code for.
This commit makes the LC_CTYPE index 0, and LC_NUMERIC equal to 1;
swapping them. The reason is to cause LC_CTYPE to get done first in the
many loops through the categories. The UTF8ness of categories is an
often needed value, and most of the time the categories will have the
same locale. LC_CTYPE is needed to calculate the UTF8ness, and by doing
it first and caching the result, the other categories likely
automatically will use the same value, without having to recalculate.
Commit: b96a82219c21de82fe344f2e660771e10b7a21b2
https://github.com/Perl/perl5/commit/b96a82219c21de82fe344f2e660771e10b7a21b2
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use new mechanism to save/restore errno
Instead of explicitly saving the errno around debugging statements, the
new more general mechanism is used.
Commit: 9f656a17d5f997f285f426bc40156bbceefeb3a0
https://github.com/Perl/perl5/commit/9f656a17d5f997f285f426bc40156bbceefeb3a0
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
XXX PORCELAIN_SET not yet defined locale.c: Move DEBUG location info
This commit takes advantage of the new mechanism to add common DEBUGGING
code to print the __FILE__ and __LINE__ of every debugging statement.
This allows those to be removed from each statement, and have them
implicitly added.
This make things consistent, and easier to read and add new statements.
Commit: dd4c631197402bf25610cce47bc92bc8334af040
https://github.com/Perl/perl5/commit/dd4c631197402bf25610cce47bc92bc8334af040
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add some asserts
Commit: f55fe30f27e39c1cc74289b20054bf3bd178fe9d
https://github.com/Perl/perl5/commit/f55fe30f27e39c1cc74289b20054bf3bd178fe9d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Reorder code, rmv unneeded conditional
Previous commits have made the conditional about being able to find the
radix character unnecessary. The called function my_langinfo_c()
handles the case properly.
This commit also makes the trivial case first in a conditional, as that
is easier to comprehend.
Commit: a02d8df4a45286d13f0b15cc1456f69f1b7d9247
https://github.com/Perl/perl5/commit/a02d8df4a45286d13f0b15cc1456f69f1b7d9247
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Reorder 'if' branches
It's better for understandability to have positive tests than negative
ones
Commit: 47440b6e653dbe8e6a36e0582926fe89cf8e2987
https://github.com/Perl/perl5/commit/47440b6e653dbe8e6a36e0582926fe89cf8e2987
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Refactor a static function
S_new_numeric() is called after the LC_NUMERIC category is changed, to
update various ancillary information Perl keeps.
This reorders the function so that on POSIX 2008 platforms, the numeric
object is created earlier. This allows for fewer operations on those
platforms, as we already have the correct value in place for querying
what the radix and thousands separator characters are.
Explanatory comments are also added.
Commit: 8e78ab0d7f580599cba28ad1ffc2b102a0e840fd
https://github.com/Perl/perl5/commit/8e78ab0d7f580599cba28ad1ffc2b102a0e840fd
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Change assert() into STATIC_ASSERT()
Commit: 13553b1af0dcf48d30c46c33851f826345388ab5
https://github.com/Perl/perl5/commit/13553b1af0dcf48d30c46c33851f826345388ab5
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use standard fold table for C locale
Copy the standard compiled-in ASCII fold table when the locale is C or
POSIX, instead of looping through all 256 characters and computing them.
This saves some time as well as ensures that any platform bugs become
irrelevant.
Commit: e115a66663b562f9384795a6bdbf3f480d917ac3
https://github.com/Perl/perl5/commit/e115a66663b562f9384795a6bdbf3f480d917ac3
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add check that strxfrm didn't fail
The code failed to take into account that strxfrm() can fail for reasons
besides buffer length. It does not return errors, and the only way to
check is to set errno to 0 beforehand, and check that it is still 0
afterwards.
Commit: b63c9ae70d60079cda23ee6a6cf6c2fb488640bd
https://github.com/Perl/perl5/commit/b63c9ae70d60079cda23ee6a6cf6c2fb488640bd
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Don't assume LC_CTYPE, LC_COLLATE are same
This code is using isCNTRL_LC which depends on LC_CTYPE to verify that
something in the LC_COLLATE locale is a control. That only works
properly if the two locales are the same. This commit adds code to
ensure they are.
Commit: 4a217c43bd1a79c71aa1f3853b867ba4d2e8b945
https://github.com/Perl/perl5/commit/4a217c43bd1a79c71aa1f3853b867ba4d2e8b945
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: strxfrm() requires LC_CTYPE eq LC_COLLATE
The libc functions strxfrm() on some platforms requires the LC_CTYPE
locale to be the same as the LC_COLLATE locale (or rather, probably that
they have the same code set, but checking for locale is cheaper).
Otherwise mojibake would result, or more likely the function will fail,
setting errno.
This commit brings the locales into alignment if necessary
Commit: 821ca7f416179f95eb7bfe6ea8a1cdf071206b53
https://github.com/Perl/perl5/commit/821ca7f416179f95eb7bfe6ea8a1cdf071206b53
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M Configure
M Cross/config.sh-arm-linux
M Cross/config.sh-arm-linux-n770
M NetWare/config.wc
M Porting/config.sh
M config_h.SH
M configure.com
M metaconfig.h
M plan9/config_sh.sample
M uconfig.h
M uconfig.sh
M uconfig64.sh
M win32/config.gc
M win32/config.vc
Log Message:
-----------
Configure: strxfrm_l
Commit: ae4182da63e0446384f83dd9514add643a17fe2a
https://github.com/Perl/perl5/commit/ae4182da63e0446384f83dd9514add643a17fe2a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M lib/locale.t
Log Message:
-----------
XXX temp: Windows debug
Commit: 0de92b96fb52ed3fe92d8063dfaf63af0a808d1d
https://github.com/Perl/perl5/commit/0de92b96fb52ed3fe92d8063dfaf63af0a808d1d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use strxfrm_l() if available
This more modern version of the function doesn't require us to change
locales.
Commit: 2a3241e8c7461bb3d96c2c56bd47c3a2141c1b68
https://github.com/Perl/perl5/commit/2a3241e8c7461bb3d96c2c56bd47c3a2141c1b68
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M mathoms.c
M proto.h
M sv.c
Log Message:
-----------
Change name of internal function
This is in preparation for working on it; the new name, mem_collxfrm_ is
in compliance with the C Standard; the old was not.
Commit: 359a7d0e1b216d5a4a320c23acd7e092ea218c4b
https://github.com/Perl/perl5/commit/359a7d0e1b216d5a4a320c23acd7e092ea218c4b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M ext/POSIX/POSIX.xs
M ext/POSIX/lib/POSIX.pod
M locale.c
M proto.h
Log Message:
-----------
XXXdelta Fix POSIX::strxfrm()
This function takes an SV containing a PV. The encoding of that PV is
based on the locale of the LC_CTYPE locale. It really doesn't make
sense to collate based off of the sequencing of a different locale, which
prior to this commit it would do if the LC_COLLATION locale were
different.
Commit: c402f06f71b7c7055ad42d45133936b722aa359e
https://github.com/Perl/perl5/commit/c402f06f71b7c7055ad42d45133936b722aa359e
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Improve debugging for mem_collxfrm()
This prints out more information, better organized.
It also moves up the info from -DLv to plain -DL
Commit: 4c3cffda84089969b87c102b582a9d6fbc5b702e
https://github.com/Perl/perl5/commit/4c3cffda84089969b87c102b582a9d6fbc5b702e
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add debug statement for collation failure
Perhaps this should be a warning to the user that we couldn't calculate
collation info for the locale, but at least there should be a way to
get that info from a DEBUG statement
Commit: e958dac759bf81183aee04b549c1fbc7bf17a8ec
https://github.com/Perl/perl5/commit/e958dac759bf81183aee04b549c1fbc7bf17a8ec
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Print code point in hex, not decimal
Hex is the more familiar form
Commit: cc307363061ff57b15041cfae724b0cb2752bb9d
https://github.com/Perl/perl5/commit/cc307363061ff57b15041cfae724b0cb2752bb9d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M ext/POSIX/POSIX.xs
M locale.c
M perl.h
Log Message:
-----------
Mark certain mutex lock macros as private
mbtowc() mblen(), and wctomb() should not be directly used by XS
writers; instead use the POSIX versions. Don't encourage the direct use
by having public macros to aid in their use.
Commit: 77cfc0ca1327acf5a14af799694de8fdb0b83315
https://github.com/Perl/perl5/commit/77cfc0ca1327acf5a14af799694de8fdb0b83315
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
perl.h: Move some code around
This is purely to make future commits have smaller real difference
listings, and involves a temporary (complemented) copy of a preprocessor
conditional.
Commit: a7af4ba2c6cbcd7c0b42fec5f525172aaa203e48
https://github.com/Perl/perl5/commit/a7af4ba2c6cbcd7c0b42fec5f525172aaa203e48
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
perl.h: Reorder cpp branches
Disposing of the trivial case first makes things easier to read.
Commit: 2554004c966fd466e632d245d8de9cd2d5a0ff82
https://github.com/Perl/perl5/commit/2554004c966fd466e632d245d8de9cd2d5a0ff82
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embedvar.h
M intrpvar.h
M locale.c
M makedef.pl
M perl.h
M sv.c
Log Message:
-----------
Make the locale mutex a general semaphore
Future commits will use this new capability, and in Configurations where
no locale locking is currently necessary.
Commit: d423972b3117117d92e95a547b6543e62c19ef44
https://github.com/Perl/perl5/commit/d423972b3117117d92e95a547b6543e62c19ef44
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embedvar.h
M intrpvar.h
M makedef.pl
M perl.h
M perlvars.h
M sv.c
Log Message:
-----------
Use general locale mutex for numeric operations
This commit removes the separate mutex for locking locale-related
numeric operations on threaded perls; instead using the general locale
one. The previous commit made that a general semaphore, so now suitable
for use for this purpose as well.
This means that the locale can be locked for the duration of some
sprintf operations, longer than before this commit. But on most modern
platforms, thread-safe locales cause this lock to expand just to a
no-op; so there is no effect on these. And on the impacted platforms,
one is not supposed to be using locales and threads in combination, as
races can occur. This lock is used on those perls to keep Perl's
manipulation of LC_NUMERIC thread-safe. And for those there is also no
effect, as they already lock around those sprintf's.
Commit: 18a14589097934967e0e09975eb35d057e9e29e0
https://github.com/Perl/perl5/commit/18a14589097934967e0e09975eb35d057e9e29e0
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
Add locale macro to wrap static-space-using fncs
Some functions return a result in a global-to-the-program buffer, or
they have an internal global buffer. Other threads must be kept from
simultaneously using that function. This macro is to be used for all
such ones dealing with locales. Ideally, there would be a separate mutex
for each such buffer space. But these functions also have to lock the
locale from changing during their execution, and there aren't that many
such functions, and they actually are rarely executed. So a single lock
will do.
This will allow future commits to have more targeted locking for
functions that don't affect the global locale.
Commit: c1a75e6eb6c6d0cc21602c38b46b82d1fa7ce513
https://github.com/Perl/perl5/commit/c1a75e6eb6c6d0cc21602c38b46b82d1fa7ce513
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
Redefine the POSIX.xs locale macros using prev commit
This commit uses the new macro introduced in the previous commit to
define the internal locale mutex macros in POSIX.xs
Commit: 00a51c1d62686c278a5e6d4b0b73f554905b6b5c
https://github.com/Perl/perl5/commit/00a51c1d62686c278a5e6d4b0b73f554905b6b5c
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
perl.h: Remove NL_LANGINFO_LOCK
This is needed in precisely one place in the code, so move it to there.
Commit: 02c1f5057f6c2aa7efc4dcfd407f8c68b1f184b8
https://github.com/Perl/perl5/commit/02c1f5057f6c2aa7efc4dcfd407f8c68b1f184b8
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
perl.h: Remove LOCALECONV_LOCK
This is needed in just one function, in locale.c, so more it there.
Commit: 5051f5799aff229314c2577daedbfdb305dbb442
https://github.com/Perl/perl5/commit/5051f5799aff229314c2577daedbfdb305dbb442
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
XXX perlembed Add PORCELAIN_SETLOCALE_LOCK/UNLOCK
This macro is used to surround raw setlocale() calls so that the return
value in a global static buffer can be saved without interference with
other threads.
There are a few very rarely occurring instances in locale.c that are
converted to use this. These previously could have been races.
The raw setlocales in the initialization function are not guarded, as
these happen early in the Perl process initialization, before threading
is enabled.
This is buggy if there are multiple embedded perls. It can't be helped.
perlembed is being updated to indicate this.
Commit: 02aca37719fd4c2d502e13f68b64d20a421eb2be
https://github.com/Perl/perl5/commit/02aca37719fd4c2d502e13f68b64d20a421eb2be
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
perl.h: Move #defining SETLOCALE_LOCK
This simplifies slightly, and will allow further simplification
Commit: ad38a37aa0d51746111df7ef0c4a3f17261040c3
https://github.com/Perl/perl5/commit/ad38a37aa0d51746111df7ef0c4a3f17261040c3
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
perl.h: Move LOCALE_READ_LOCK #definition
To enable future simplifications
Commit: 1e64def593515943ec4ded0c8f067a034bbb5be6
https://github.com/Perl/perl5/commit/1e64def593515943ec4ded0c8f067a034bbb5be6
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M intrpvar.h
M locale.c
M makedef.pl
M perl.c
M perl.h
M sv.c
Log Message:
-----------
locale.c: Move #define to perl.h; use it elsewhere
Rather than recalculate this combined conditional, do it once in
perl.h.
Commit: e50fdd30831927e359cb6681018eb23161643992
https://github.com/Perl/perl5/commit/e50fdd30831927e359cb6681018eb23161643992
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Mitigate unsafe threaded locales
This a new set of macros and functions to do locale changing and
querying for platforms where perl is compiled with threads, but the
platform doesn't have thread-safe locale handling.
All it does is:
1) The return of setlocale() is always safely saved in a per-thread
buffer, and
2) setlocale() is protected by a mutex from other threads which are
using perl's locale functions.
This isn't much, but it might be enough to get some programs to work on
such platforms which rarely change or query the locale.
Commit: 74acf4cbacc056ea41b1e3e2dd671ae3470b05c4
https://github.com/Perl/perl5/commit/74acf4cbacc056ea41b1e3e2dd671ae3470b05c4
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
XXX make sure comments get moved appropriately perl.h: Remove now empty block
Previous commits have left this empty except for comments.
Commit: 8eb54190679ca81300d46bafa177ebdcb5c49bf8
https://github.com/Perl/perl5/commit/8eb54190679ca81300d46bafa177ebdcb5c49bf8
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M pp.c
Log Message:
-----------
XXX pp.c: do %g print under mutex,
Commit: 5b036e10fc173d4d2e714a13e555f38cb41b13f0
https://github.com/Perl/perl5/commit/5b036e10fc173d4d2e714a13e555f38cb41b13f0
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M ebcdic_tables.h
M embedvar.h
M globvar.sym
M inline.h
M intrpvar.h
M perl.h
M regen/ebcdic.pl
M sv.c
Log Message:
-----------
Make fc(), /i thread-safe on participating platforms
A long standing bug in Perl that has gone undetected is that the array
is global that is created when changing locales and tells fc() and qr//i
matching what the folds are in the new locale.
What this means is that any program only has one set of fold definitions
that apply to all threads within it, even if we claim that the locales
are thread-safe on the given platform. One possibility for this going
undetected so long is that no one is using locales on multi-threaded
systems much. Another possibility is that modern UTF-8 locales have the
same set of folds as any other one.
It is a simple matter to make the fold array per-thread instead of
per-process, and that solves the problem transparently to other code.
I discovered this stress-testing locale handling under threads. That
test will be added in a future commit.
Commit: 18667f46309d3144bdc99ffd896bdae43104a809
https://github.com/Perl/perl5/commit/18667f46309d3144bdc99ffd896bdae43104a809
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M inline.h
M locale.c
Log Message:
-----------
XXX temp debug? locale.c, inline.h:foldEQ_locale
Commit: b67b471e53d9d0caf048a5c0b4c571afced13db6
https://github.com/Perl/perl5/commit/b67b471e53d9d0caf048a5c0b4c571afced13db6
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c comments
Commit: 11e832e10ac81530585347bbe8c02d3b6e71b499
https://github.com/Perl/perl5/commit/11e832e10ac81530585347bbe8c02d3b6e71b499
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
XXX prob drop; done before anything so no races
Commit: 770c58b55b43e0252980e4a4ff004b0c55e30a82
https://github.com/Perl/perl5/commit/770c58b55b43e0252980e4a4ff004b0c55e30a82
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
perl.h: Add #define for gwENVr_LOCALEr_UNLOCK
This is for functions that read the locale and environment and write to
some global space.
Commit: 2ea174632a2cff859ee09cd871e935d845c11293
https://github.com/Perl/perl5/commit/2ea174632a2cff859ee09cd871e935d845c11293
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
M time64.c
Log Message:
-----------
Remove ENV_LOCALE_LOCK/UNLOCK macros
These are subsumed by gwENVr_LOCALEr_LOCK created in the previous
commit.
Commit: d40076f9cd46bd0c2f250ee354312b1523decf53
https://github.com/Perl/perl5/commit/d40076f9cd46bd0c2f250ee354312b1523decf53
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
M time64.c
M util.c
Log Message:
-----------
Change ENV/LOCALE locking read macro names
The old name was confusing.
Commit: 83dfef12ff775bee060d0204ec86e5460957cee8
https://github.com/Perl/perl5/commit/83dfef12ff775bee060d0204ec86e5460957cee8
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
perl.h: Move some statements
So they are closer to related statements
Commit: a0c03c9e68ec0e91ccca7ee5aa28dc0753e21d92
https://github.com/Perl/perl5/commit/a0c03c9e68ec0e91ccca7ee5aa28dc0753e21d92
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
M util.c
Log Message:
-----------
perl.h: Finish implementing combo ENV/LOCALE mutexes
There are cases where an executing function is vulnerable to either the
locale or environment being changed by another thread. This commit
implements macros that use mutexes to protect these critical sections.
There are two cases that exist: one where the functions only read; and
one where they can also need exclusive control so that a competing
thread can't overwrite the returned static buffer before it is safely
copied.
5.32 had a placeholder for these, but didn't actually implement it.
Instead it locked just the ENV portion. On modern platforms with
thread-safe locales, the locale portion is a no-op anyway, so things
worked on them.
This new commit extends that safety to other platforms. This has long
been a vulnerability in Perl.
Commit: 75c8d174a691fe4fcee5357b77a911693b54c0c2
https://github.com/Perl/perl5/commit/75c8d174a691fe4fcee5357b77a911693b54c0c2
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M time64.c
Log Message:
-----------
time64.c: Remove no longer needed code
This code defined some macros; those are now defined by perl.h
Commit: 892693b71989d31519f6a89fb93d037141c0c6a8
https://github.com/Perl/perl5/commit/892693b71989d31519f6a89fb93d037141c0c6a8
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M pp_sys.c
Log Message:
-----------
XXX need to StructCopy pp_sys mutexes
Commit: b17adc415cedce456fb7ec39be43044ef2b0a238
https://github.com/Perl/perl5/commit/b17adc415cedce456fb7ec39be43044ef2b0a238
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M win32/win32.c
Log Message:
-----------
win32.c: Add mutexes around some calls
These could have races.
Commit: d3802d7ee0af90ece2270ab00e49460fa0e3331a
https://github.com/Perl/perl5/commit/d3802d7ee0af90ece2270ab00e49460fa0e3331a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M ext/POSIX/POSIX.xs
Log Message:
-----------
POSIX.xs env locks, check file for more
Commit: 5c888e56e6b4562710639111463eb972cfc3b3f5
https://github.com/Perl/perl5/commit/5c888e56e6b4562710639111463eb972cfc3b3f5
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M util.c
Log Message:
-----------
util.c: mktime needs to run under a mutex
per the Posix standard
Commit: c59b8d5d064213925b0bdd033a16b9ee6cfec9a9
https://github.com/Perl/perl5/commit/c59b8d5d064213925b0bdd033a16b9ee6cfec9a9
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M util.c
Log Message:
-----------
util.c: Add locks around strftime() calls
Commit: b3d31da2b548a9bcc208b1b7973acc7aaf77be42
https://github.com/Perl/perl5/commit/b3d31da2b548a9bcc208b1b7973acc7aaf77be42
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M cygwin/cygwin.c
Log Message:
-----------
cygwin
Commit: 8c0392386b26796c94920abdd3cf6cedd0897371
https://github.com/Perl/perl5/commit/8c0392386b26796c94920abdd3cf6cedd0897371
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M os2/os2.c
Log Message:
-----------
os2: Use many reader lock instead of exclusive
This is just reading the environment, not changing it, so a many readers
can be accessing it at the same time.
Commit: 237175bbe058250a46f5f2e457b81dae2bde2ab9
https://github.com/Perl/perl5/commit/237175bbe058250a46f5f2e457b81dae2bde2ab9
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M cpan/Time-Piece/Piece.pm
M cpan/Time-Piece/Piece.xs
Log Message:
-----------
XXX cpan PR Time-Piece: Add locks
This add mutex locking around some unsafe thread operations to make this
module thread-safe.
Commit: 162ee4f8e290db91bd519a1e9a851f89b18d36b3
https://github.com/Perl/perl5/commit/162ee4f8e290db91bd519a1e9a851f89b18d36b3
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M cpan/Time-Piece/Piece.xs
Log Message:
-----------
Time-Piece: Use foldEQ_locale() if available
This supported core function is thread-safe and knows about Perl
internals, so is preferable to the similar libc function, which is now
used only as a fallback. This commit also bomb proofs the code by
adding an additional fallback, specified in C89, which isn't a great
substituted, but far better than nothing.
Commit: 65acabe2f3f2653104cd7070983aa58636846078
https://github.com/Perl/perl5/commit/65acabe2f3f2653104cd7070983aa58636846078
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M cpan/Time-Piece/Piece.xs
Log Message:
-----------
Time-Piece: Use isSPACE, not isspace
The latter gives results that are dependent on the program's underlying
locale, and so may be inconsistent.
If locale dependence is actually desired, isSPACE_LC should be used, as
it knows about various things the module writer shouldn't have to
concern themselves with. It is supported since 5.004
Commit: 8eefa65fddb423ed2e62901002d619eab9e15858
https://github.com/Perl/perl5/commit/8eefa65fddb423ed2e62901002d619eab9e15858
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M cpan/Time-Piece/Piece.xs
Log Message:
-----------
Time-Piece: Use isDIGIT, not isdigit
The latter gives results that are dependent on the program's underlying
locale, and so may be inconsistent.
If locale dependence is actually desired, isDIGIT_LC should be used, as
it knows about various things the module writer shouldn't have to
concern themselves with. It is supported since 5.004
Commit: 56171d1da6c32ee25f883b71ca866c7b1873b114
https://github.com/Perl/perl5/commit/56171d1da6c32ee25f883b71ca866c7b1873b114
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M cpan/Time-Piece/Piece.xs
Log Message:
-----------
Time-Piece: Use isUPPER, not isupper
The latter gives results that are dependent on the program's underlying
locale, and so may be inconsistent.
If locale dependence is actually desired, isUPPER_LC should be used, as
it knows about various things the module writer shouldn't have to
concern themselves with. It is supported since 5.004
Commit: 5414fc93008b699ff3e4512754e4340b57e0f56a
https://github.com/Perl/perl5/commit/5414fc93008b699ff3e4512754e4340b57e0f56a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M pod/perlhacktips.pod
Log Message:
-----------
XXX incomplete perlhacktips:
Commit: dff7809eda43c4ee89c0335c9adb838e66d59e1e
https://github.com/Perl/perl5/commit/dff7809eda43c4ee89c0335c9adb838e66d59e1e
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M dist/IO/IO.pm
M dist/IO/IO.xs
Log Message:
-----------
XXX check if using ppport IO.xs: Remove fallback code furnished by ppport
Commit: 9d9dee266361c7b53abc1c615ed51345cf17943b
https://github.com/Perl/perl5/commit/9d9dee266361c7b53abc1c615ed51345cf17943b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M hints/freebsd.sh
Log Message:
-----------
XXX check with freebsd: hints/freebsd.sh
Commit: 1ec5a47485bc58bb64cad938d60af022aabf20a9
https://github.com/Perl/perl5/commit/1ec5a47485bc58bb64cad938d60af022aabf20a9
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M thread.h
Log Message:
-----------
thread.h: White-space, braces only
Commit: cf2b0fdc0200b04dca8a219911dba17ca92653de
https://github.com/Perl/perl5/commit/cf2b0fdc0200b04dca8a219911dba17ca92653de
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M thread.h
Log Message:
-----------
XXX thread.h Save errno around lock/unlock
Commit: b813e79a65be193ec00d2cf6842a78fe4e26bdc4
https://github.com/Perl/perl5/commit/b813e79a65be193ec00d2cf6842a78fe4e26bdc4
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
XXX perl.h: Debugging mutex lock'
Commit: 4ace5b455064d6a705939fae42fcc951174b6851
https://github.com/Perl/perl5/commit/4ace5b455064d6a705939fae42fcc951174b6851
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M cpan/Time-Piece/Piece.xs
M handy.h
M iperlsys.h
M locale.c
M perl.h
M regen/reentr.pl
M regexec.c
M sv.c
M util.c
Log Message:
-----------
Notes
Commit: 67e9f919f99117c04d1a2651715c224db7602f03
https://github.com/Perl/perl5/commit/67e9f919f99117c04d1a2651715c224db7602f03
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M ext/POSIX/POSIX.xs
M locale.c
M perl.h
Log Message:
-----------
locks
Commit: 3f017cfa47bb54d7487dfbf1e6a75c4e4475d8b3
https://github.com/Perl/perl5/commit/3f017cfa47bb54d7487dfbf1e6a75c4e4475d8b3
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
XXX locale.c: Kludge because C obj getting destroyed
Commit: 384bed66a54dee630965967019e2a48587e31dd5
https://github.com/Perl/perl5/commit/384bed66a54dee630965967019e2a48587e31dd5
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M .github/workflows/testsuite.yml
Log Message:
-----------
Make DEBUGGING the default on CI
Commit: a15a97fcb7bd1d88cb9f2a906505b2a3b960e7fc
https://github.com/Perl/perl5/commit/a15a97fcb7bd1d88cb9f2a906505b2a3b960e7fc
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M t/run/locale.t
Log Message:
-----------
t/run/locale.t
Commit: 0e9a38539264f67dace3ed5869fb457c633433fc
https://github.com/Perl/perl5/commit/0e9a38539264f67dace3ed5869fb457c633433fc
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M t/run/locale.t
Log Message:
-----------
t/run/locale.t: Move init stmt
This makes it easier to add a line to turn on debugging temporarily
Commit: 89c99c6c5b8cc611ed07e5193c938183a7c1b6a0
https://github.com/Perl/perl5/commit/89c99c6c5b8cc611ed07e5193c938183a7c1b6a0
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M t/run/locale.t
Log Message:
-----------
XXX run/locale.t temp win
Commit: c6a2949d93702f286b7a4bc12f899f22752e3f0b
https://github.com/Perl/perl5/commit/c6a2949d93702f286b7a4bc12f899f22752e3f0b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M t/porting/customized.dat
M vutil.c
Log Message:
-----------
vutil.c: Clean up white space
Change tabs to blanks; Fix indentation; chomp trailing white space
Remove some blank lines that don't contribute to readability
Commit: 1b43756564094c8c5f1d5c0990e160ab321dd191
https://github.com/Perl/perl5/commit/1b43756564094c8c5f1d5c0990e160ab321dd191
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M t/porting/customized.dat
M vutil.c
Log Message:
-----------
vutil.c: Simplify locale handling
I read the code over and realized that there was a much simpler way to
do things.
Commit: e70fbe8ab488bf552d3d4ea46be6ee26ee6e39d1
https://github.com/Perl/perl5/commit/e70fbe8ab488bf552d3d4ea46be6ee26ee6e39d1
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Change a branch into an assert
This code should no longer be necessary; but verify
Commit: 8c49856aab200a2830ed9efb822a50f67574bc71
https://github.com/Perl/perl5/commit/8c49856aab200a2830ed9efb822a50f67574bc71
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M t/loc_tools.pl
Log Message:
-----------
XXX loc_tools: debug, white space
Commit: 5c5178be3ad098124da22479133742e9551e6471
https://github.com/Perl/perl5/commit/5c5178be3ad098124da22479133742e9551e6471
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
Add pTHX to locale_thread_init()
Commit: 012e886a640ae89107ac61e7f6ccdb34b5761da3
https://github.com/Perl/perl5/commit/012e886a640ae89107ac61e7f6ccdb34b5761da3
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
l
Commit: 802721705136eade63a9f3f7a1dc349b33bfa4b9
https://github.com/Perl/perl5/commit/802721705136eade63a9f3f7a1dc349b33bfa4b9
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embedvar.h
M intrpvar.h
M locale.c
M sv.c
Log Message:
-----------
PLcurlocales
Commit: a35b84691bf163cfc474f3723646e37e4c748c5b
https://github.com/Perl/perl5/commit/a35b84691bf163cfc474f3723646e37e4c748c5b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M lib/locale.t
Log Message:
-----------
lib/locale.t FILE debug
Commit: d400d25fe74a31eeebedc24c16c539f107990b0e
https://github.com/Perl/perl5/commit/d400d25fe74a31eeebedc24c16c539f107990b0e
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: windows DEBUG stmts
Commit: 7f04111e48cd31e66cb07bd42e7fe0bc0c18f00d
https://github.com/Perl/perl5/commit/7f04111e48cd31e66cb07bd42e7fe0bc0c18f00d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M proto.h
Log Message:
-----------
f save_to_buffer ignore return
Commit: 07b5c1b8bcb62871004b9ebf255009e5fa6890e1
https://github.com/Perl/perl5/commit/07b5c1b8bcb62871004b9ebf255009e5fa6890e1
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Add layer for char classification/case change
This layer currently expands to just the layer below it, but that will
be changed in a future commit.
Commit: 6c320170d6500be9045e4e41280b3d999485039f
https://github.com/Perl/perl5/commit/6c320170d6500be9045e4e41280b3d999485039f
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M dist/ExtUtils-ParseXS/lib/perlxs.pod
M t/porting/known_pod_issues.dat
Log Message:
-----------
perlxs
Commit: b6a4dbbbda5126d4feb06f3a0da440b75988a3b1
https://github.com/Perl/perl5/commit/b6a4dbbbda5126d4feb06f3a0da440b75988a3b1
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
Log Message:
-----------
XXX Temp dont use querylocale()
Commit: f617adfabb71e8b958cf29f65cbe2202dda31870
https://github.com/Perl/perl5/commit/f617adfabb71e8b958cf29f65cbe2202dda31870
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
l
Commit: cd6e4cbaef42131cb0514f2c8f30c5a4c49e3efc
https://github.com/Perl/perl5/commit/cd6e4cbaef42131cb0514f2c8f30c5a4c49e3efc
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embedvar.h
M intrpvar.h
M locale.c
M sv.c
Log Message:
-----------
Revert "PLcurlocales"
This reverts commit cd1fd76eac05b9ca866bb6f1dae6151767aa3d76.
Commit: e0090b3703eddc42b8037cd4ba3468d693f2a472
https://github.com/Perl/perl5/commit/e0090b3703eddc42b8037cd4ba3468d693f2a472
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
locale.c: Rmv unused code
The code to handle changing LC_NUMERIC and LC_COLLATION handled the
possibility of being passed a NULL locale name. But we're not changing
things unless we have a new locale, and know its name, so a name is
always passed
Commit: d5320dfd082b50074c9c363ac0997b1f4c98394b
https://github.com/Perl/perl5/commit/d5320dfd082b50074c9c363ac0997b1f4c98394b
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M intrpvar.h
Log Message:
-----------
intrpvar.h: Swap position of two defns; add comment
Commit: c726930bace4ef693115e97efbdcda428bd6f9ac
https://github.com/Perl/perl5/commit/c726930bace4ef693115e97efbdcda428bd6f9ac
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M intrpvar.h
M locale.c
Log Message:
-----------
locale.c: Add 'Lazy' location changing
When comparing two strings for order under 'use locale', one can call
strcoll() which creates hidden modified versions of the strings based on
the locale's collation ordering, does the comparison, and then throws
away the modified versions.
Or one can call strxfrm() to create a non-hidden modified version of
each string, and then do a straight comparison. The advantage here is
that you are in control of when to discard the modified version, and the
(expensive) transformation is done just once, no matter how many times a
comparison is done.
Perl assumes that a string will be compared multiple times, so the first
time it happens under 'use locale', strxfrm() is called, and the
modified string is attached via magic to the SV. The modified string is
discarded if the string changes, or is recomputed if the locale has
changed since the computation was done.
The transformation generally occupies some multiple of size of the
original string. Memory must be allocated to hold it. For any given
locale, the amount is predictable for all strings, roughly via a linear
equation "mx+b", where x is the size of the original string. By
computing 'm' and 'b' once, Perl can allocate enough memory to hold the
transformation, but not too much. (m and b are adjusted up as necessary
as more strings get transformed.) This minimizes mallocs.
But the calculation of m and b is somewhat expensive, and only necessary
if the program actually does a string compare under 'use locale'.
This commit defers the calculation until needed. It does the bare
minimum of changes accomplish this. The next commit will rearrange
things.
Commit: d27bf74b16d28d82a9ccfb52d604693b4895b40f
https://github.com/Perl/perl5/commit/d27bf74b16d28d82a9ccfb52d604693b4895b40f
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Move code, white-space, comment only
This moves the function created in the previous commit to a more logical
place in the file; just before its only call. It also removes nested
blocks that are no longer necessary.
Commit: 8cbfa99f5627fdb53809278df36c654098bcf16a
https://github.com/Perl/perl5/commit/8cbfa99f5627fdb53809278df36c654098bcf16a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M locale.c
M util.c
Log Message:
-----------
XXX Configure strftime() is C89
We can assume it exists
Commit: bf58be0273be820d4700c197b12ae4fa0401d1f2
https://github.com/Perl/perl5/commit/bf58be0273be820d4700c197b12ae4fa0401d1f2
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M perl.h
M sv.c
Log Message:
-----------
perl.h: Change macro name to be C conformant
Leading underscores in names are undefined
Commit: a6d3d2743f07902eff17ee66fbc6376c53cbb44d
https://github.com/Perl/perl5/commit/a6d3d2743f07902eff17ee66fbc6376c53cbb44d
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M patchlevel.h
Log Message:
-----------
patchlevel.h: White-space only: properly indent
Commit: 22076748290e92a560be657fc5b32b009abb785a
https://github.com/Perl/perl5/commit/22076748290e92a560be657fc5b32b009abb785a
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M patchlevel.h
Log Message:
-----------
Kludge to get cygwin to compile
Commit: 73440f4663d425a2293ebfb6e60da3cc884b74e7
https://github.com/Perl/perl5/commit/73440f4663d425a2293ebfb6e60da3cc884b74e7
Author: Karl Williamson <[email protected]>
Date: 2021-04-06 (Tue, 06 Apr 2021)
Changed paths:
M cygwin/cygwin.c
M embed.fnc
M embed.h
M ext/XS-APItest/t/locale.t
M handy.h
M intrpvar.h
M lib/locale.t
M lib/locale_threads.t
M locale.c
M perl.h
M pod/perldiag.pod
M proto.h
M sv.c
M t/loc_tools.pl
M t/run/locale.t
Log Message:
-----------
more18
Compare: https://github.com/Perl/perl5/compare/a98868e4c8e8...73440f4663d4