Branch: refs/heads/smoke-me/khw-locale
Home: https://github.com/Perl/perl5
Commit: c8755996f38b4ff97548ee570bd24f3afb35dfa9
https://github.com/Perl/perl5/commit/c8755996f38b4ff97548ee570bd24f3afb35dfa9
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M perl.h
Log Message:
-----------
Add ability to easily add info to DEBUG output
This commit adds two macros that a user can define and recompile Perl to
get every active DEBUG statement to do something beyond what it would
normally do.
This allows someone to recompile Perl when they need to delve deeper
into fixing a bug without increasing memory use or slowing execution
otherwise.
Commit: b993d913bb625283030244bf5dd9200ddc0f0db9
https://github.com/Perl/perl5/commit/b993d913bb625283030244bf5dd9200ddc0f0db9
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M mg.c
Log Message:
-----------
XXX better message: mg.c: Silence compiler warning
Commit: 5c38d3a2d8acba0e65a7af63f3b7b80063a95040
https://github.com/Perl/perl5/commit/5c38d3a2d8acba0e65a7af63f3b7b80063a95040
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M lib/locale_threads.t
Log Message:
-----------
XXX locale_threads
Commit: 006776b2684f397db863f4754d99484eee43584f
https://github.com/Perl/perl5/commit/006776b2684f397db863f4754d99484eee43584f
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 114e79953743dc9bd7e53ad063b06fbe5d79231b
https://github.com/Perl/perl5/commit/114e79953743dc9bd7e53ad063b06fbe5d79231b
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 6d03a60aee8024c0b7b305bf24cd14391d5c343c
https://github.com/Perl/perl5/commit/6d03a60aee8024c0b7b305bf24cd14391d5c343c
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M handy.h
M numeric.c
M regcomp.c
M regexec.c
M utfebcdic.h
Log Message:
-----------
Change 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: 6820a0986d4c53a64e1a29f1df318d7f830ec8c8
https://github.com/Perl/perl5/commit/6820a0986d4c53a64e1a29f1df318d7f830ec8c8
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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 isWORDCHAR_LC definition for non-Windows to match that
platform, adding an UNLIKELY().
Commit: 985255a1ee6fdf1e04b19544def843b95bc8543e
https://github.com/Perl/perl5/commit/985255a1ee6fdf1e04b19544def843b95bc8543e
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: White-space, comment only
Commit: 0ab50172574a1deff344dbd70f05f672294ae0f8
https://github.com/Perl/perl5/commit/0ab50172574a1deff344dbd70f05f672294ae0f8
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Remove only call to an internal macro
Replace isIDFIRST_LC with a slightly faster implementation, in line
with what isWORDCHAR already does
Commit: 36b146bc042f1e9994c62ebb2b943de5e6f23a60
https://github.com/Perl/perl5/commit/36b146bc042f1e9994c62ebb2b943de5e6f23a60
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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 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: 64a90ab8bbc30bef6a699778dda2feec900ab9ea
https://github.com/Perl/perl5/commit/64a90ab8bbc30bef6a699778dda2feec900ab9ea
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Rmv unneeded generality
The possible first character of an ID is always an alpha in the range
0-255, so there is no harm changing from the former to the latter. And
future changes would otherwise have needed an extra parameter in a bunch
of macros.
Commit: eccdf5964e2c3d019d2ce58a6d6b8ece4ea7d62c
https://github.com/Perl/perl5/commit/eccdf5964e2c3d019d2ce58a6d6b8ece4ea7d62c
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M handy.h
Log Message:
-----------
handy.h: Don't special case isASCII_LC
This was an attempt to save instructions, but future commits will need
the generality
Commit: c3d64c6157afba3dc8143c7cf4ae1ae2c93c0e2a
https://github.com/Perl/perl5/commit/c3d64c6157afba3dc8143c7cf4ae1ae2c93c0e2a
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 602fa1c843d382650832fd722a8b9fff65e62519
https://github.com/Perl/perl5/commit/602fa1c843d382650832fd722a8b9fff65e62519
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M embed.fnc
M embed.h
M globvar.sym
M handy.h
M inline.h
M perl.h
M proto.h
M regexec.c
Log Message:
-----------
regexec.c: Use function call table to streamline code
This replaces a switch() statement with a function pointer table. But
the main reason I'm doing this is for future functionality.
Commit: 15efb98371355c5c0c595cb2eaffc76b4029e411
https://github.com/Perl/perl5/commit/15efb98371355c5c0c595cb2eaffc76b4029e411
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Declare three static arrays to be so.
Commit: 1f373db48e5c203ab78967bd346b8cee1f8815f7
https://github.com/Perl/perl5/commit/1f373db48e5c203ab78967bd346b8cee1f8815f7
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 825af3412df032f522b2da0d59f08fddda78221b
https://github.com/Perl/perl5/commit/825af3412df032f522b2da0d59f08fddda78221b
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: e027978bf9d23d61626fbaaaa54cc77ecf2f73d5
https://github.com/Perl/perl5/commit/e027978bf9d23d61626fbaaaa54cc77ecf2f73d5
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: cbaead4baf5a1ee9e51cfce241a74ac2f6148c34
https://github.com/Perl/perl5/commit/cbaead4baf5a1ee9e51cfce241a74ac2f6148c34
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 6cf6a0e6560c668cc6e4475b09950b53bb6d5fe9
https://github.com/Perl/perl5/commit/6cf6a0e6560c668cc6e4475b09950b53bb6d5fe9
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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 macro is the
base level.
Commit: 16fe6a838b55a83082c190b0ceedca5bfd130b85
https://github.com/Perl/perl5/commit/16fe6a838b55a83082c190b0ceedca5bfd130b85
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 3b0e2f265ea15abc5da7168681da6fc289ecef4c
https://github.com/Perl/perl5/commit/3b0e2f265ea15abc5da7168681da6fc289ecef4c
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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 edgest of the locale-handling code; once found the index is used in
future bits of the current operation.
Commit: 98285bc830877ed0a514685cc70e95e55552c806
https://github.com/Perl/perl5/commit/98285bc830877ed0a514685cc70e95e55552c806
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 7a25a487f637e8e29837aeaa6efa6a398d13bda7
https://github.com/Perl/perl5/commit/7a25a487f637e8e29837aeaa6efa6a398d13bda7
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: aea8cdb87ce140609b579ffdc75ae7694c8952cf
https://github.com/Perl/perl5/commit/aea8cdb87ce140609b579ffdc75ae7694c8952cf
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use nocontext; avoid rarely needed dTHX
This is a rare case; no point in doing a dTHX just for it.
Commit: 5bcf0e76ddc5eb7760c60d7a88462594a74bff10
https://github.com/Perl/perl5/commit/5bcf0e76ddc5eb7760c60d7a88462594a74bff10
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: dc09900abe522515570dead7392d3f4262b4d352
https://github.com/Perl/perl5/commit/dc09900abe522515570dead7392d3f4262b4d352
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 6d2958ce7d956a524fc6d8a44d8b02cc27ddd8f1
https://github.com/Perl/perl5/commit/6d2958ce7d956a524fc6d8a44d8b02cc27ddd8f1
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 3dad5f8a08cab03a4b032a7f918a0fb941947512
https://github.com/Perl/perl5/commit/3dad5f8a08cab03a4b032a7f918a0fb941947512
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 026d650ae54b22c891b11e8f36e3ee408e483ff6
https://github.com/Perl/perl5/commit/026d650ae54b22c891b11e8f36e3ee408e483ff6
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: d5be21c0b27ec1ea0177cc74cf1a670129e92504
https://github.com/Perl/perl5/commit/d5be21c0b27ec1ea0177cc74cf1a670129e92504
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: e5f751bc5c7bfcb892208b7b5453fae8e7803e84
https://github.com/Perl/perl5/commit/e5f751bc5c7bfcb892208b7b5453fae8e7803e84
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: ac83628bd0c0675873b4a4b4665804adfee75ee9
https://github.com/Perl/perl5/commit/ac83628bd0c0675873b4a4b4665804adfee75ee9
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: da298451db22b5c4e8ad11c8515e77ad70410298
https://github.com/Perl/perl5/commit/da298451db22b5c4e8ad11c8515e77ad70410298
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 6c72c9b96ece19880cf6d4ed7c75a1fd445d4b45
https://github.com/Perl/perl5/commit/6c72c9b96ece19880cf6d4ed7c75a1fd445d4b45
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 264d4c69dfa47e3d427bc8810f2c9e2174be9950
https://github.com/Perl/perl5/commit/264d4c69dfa47e3d427bc8810f2c9e2174be9950
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 23d3565686db452781a997c326b77abe34a69ba7
https://github.com/Perl/perl5/commit/23d3565686db452781a997c326b77abe34a69ba7
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: d5f06a9c111bc2c23bf88a1b6e031b67fc144435
https://github.com/Perl/perl5/commit/d5f06a9c111bc2c23bf88a1b6e031b67fc144435
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: b0c5e91f11f833462d7ca6c71950d468a175ae0d
https://github.com/Perl/perl5/commit/b0c5e91f11f833462d7ca6c71950d468a175ae0d
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 35c757a17ab91f94badc7423ac799a80d2d3339b
https://github.com/Perl/perl5/commit/35c757a17ab91f94badc7423ac799a80d2d3339b
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 1ff56028ae0060d5011eb1faf1fcbd9e2efeb575
https://github.com/Perl/perl5/commit/1ff56028ae0060d5011eb1faf1fcbd9e2efeb575
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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.
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: 064f09f013baa9a105c42f150171aa958a62558f
https://github.com/Perl/perl5/commit/064f09f013baa9a105c42f150171aa958a62558f
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 30a70470784402c89876287f919ac0be974f2910
https://github.com/Perl/perl5/commit/30a70470784402c89876287f919ac0be974f2910
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
Allow use of glibc undocumented locale fcn
glibc does not furnish querylocale() that Darwin and *BSD systems do.
But glibc does provide a long-standing, undocumented querylocale
equivalent.
Perl provides a workaround for systems without querylocale(), but this
commit causes -Accflags=-DUSE_NL_LOCALE_NAME when passed to Configure to
use the undocumented function instead of the workaround. For now, I am
not otherwise documenting this ability, since the underlying function
isn't documented.
Commit: b67236a233c0441080e7cf9f9cebbdf50ce6d107
https://github.com/Perl/perl5/commit/b67236a233c0441080e7cf9f9cebbdf50ce6d107
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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 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: 77a1d31e1a5e900de6a22cfd621f3d296d2f5f5b
https://github.com/Perl/perl5/commit/77a1d31e1a5e900de6a22cfd621f3d296d2f5f5b
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: af5fc453549c172c8e04fd2355ad6c464a3c5664
https://github.com/Perl/perl5/commit/af5fc453549c172c8e04fd2355ad6c464a3c5664
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: a163ecc30228e589d5bfc2a30ea31a27bdff5bad
https://github.com/Perl/perl5/commit/a163ecc30228e589d5bfc2a30ea31a27bdff5bad
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: c6101175fc9f0c98c5a4b60290947dbb3b01c3e7
https://github.com/Perl/perl5/commit/c6101175fc9f0c98c5a4b60290947dbb3b01c3e7
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: babe3742c27cc3f46701db01cd6db4fafc485b78
https://github.com/Perl/perl5/commit/babe3742c27cc3f46701db01cd6db4fafc485b78
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: e194f85ff178f7200ee96db1939e9d9f59790dc4
https://github.com/Perl/perl5/commit/e194f85ff178f7200ee96db1939e9d9f59790dc4
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: a3305b012d7d6e6d7ca5ac507d50ee27c5b1808c
https://github.com/Perl/perl5/commit/a3305b012d7d6e6d7ca5ac507d50ee27c5b1808c
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: cf708548343ac571aa8498bf695417969e7ca1bc
https://github.com/Perl/perl5/commit/cf708548343ac571aa8498bf695417969e7ca1bc
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 14c569dc42151d5b5bcc006e38268c6a8696d6f8
https://github.com/Perl/perl5/commit/14c569dc42151d5b5bcc006e38268c6a8696d6f8
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 50c9a37136377871e8614ddbd4a15cdcb29f5f9f
https://github.com/Perl/perl5/commit/50c9a37136377871e8614ddbd4a15cdcb29f5f9f
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 58153e2b60db1573f25d76845e0b2003efa5e59c
https://github.com/Perl/perl5/commit/58153e2b60db1573f25d76845e0b2003efa5e59c
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M ext/POSIX/POSIX.xs
Log Message:
-----------
POSIX.xs: White-space only
Properly indent some nested preprocessor directives
Commit: d6421c3a8ae4863292956f7e43a92d1cdd88d8ad
https://github.com/Perl/perl5/commit/d6421c3a8ae4863292956f7e43a92d1cdd88d8ad
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 3736875fb870e96c496fdd98665dac79f106dc93
https://github.com/Perl/perl5/commit/3736875fb870e96c496fdd98665dac79f106dc93
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 78fb0517bff7e4f5a5c027a4b34b1c0b216de81f
https://github.com/Perl/perl5/commit/78fb0517bff7e4f5a5c027a4b34b1c0b216de81f
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 766b758d3be33440f86bd6e4ea926982f34b344e
https://github.com/Perl/perl5/commit/766b758d3be33440f86bd6e4ea926982f34b344e
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 7f366b180b053f9da04d9b18c8b68f23266bca81
https://github.com/Perl/perl5/commit/7f366b180b053f9da04d9b18c8b68f23266bca81
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 06ff9eebfa6f90f8ce1269d4bf57a91223a8ce94
https://github.com/Perl/perl5/commit/06ff9eebfa6f90f8ce1269d4bf57a91223a8ce94
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: fca10969ffa2f3fd5403f19d83b4a0750534f3c2
https://github.com/Perl/perl5/commit/fca10969ffa2f3fd5403f19d83b4a0750534f3c2
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: f2cf234531982edbd8e7ae5538a41351284f2b81
https://github.com/Perl/perl5/commit/f2cf234531982edbd8e7ae5538a41351284f2b81
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 79410a6dfeaecee5401159b4a94b2da2a3058b8f
https://github.com/Perl/perl5/commit/79410a6dfeaecee5401159b4a94b2da2a3058b8f
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use typedef to simplify
This allows some preprocessor conditionals to be removed
Commit: e379915665fe0160836560110fafd6ac2e4120be
https://github.com/Perl/perl5/commit/e379915665fe0160836560110fafd6ac2e4120be
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Rmv redundant cBOOL()
strEQ and && already return booleans
Commit: 7d0d7372ea5af053affa16533ba66091b17f4a5a
https://github.com/Perl/perl5/commit/7d0d7372ea5af053affa16533ba66091b17f4a5a
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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 now have seen evidence this guess was wrong, so give up
on it.
This also no longer returns just an empty string in certain cases.
nl_langinfo() itself doesn't, so conform to that.
Commit: 6692f7dd5bdf76f3d360bff67e8484ffb9a49abb
https://github.com/Perl/perl5/commit/6692f7dd5bdf76f3d360bff67e8484ffb9a49abb
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 19f329bb4abede125ce6d0a0ba249aaa28ce8df0
https://github.com/Perl/perl5/commit/19f329bb4abede125ce6d0a0ba249aaa28ce8df0
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 6ec969a93e973854fd533ea4722c03f434e55793
https://github.com/Perl/perl5/commit/6ec969a93e973854fd533ea4722c03f434e55793
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 350dd2ad5441e2061eef5572d0ea1c287304b25d
https://github.com/Perl/perl5/commit/350dd2ad5441e2061eef5572d0ea1c287304b25d
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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 before blindly changing locales that we aren't
already in the desired one, in which case this could be just as well a
no-op, and with this commit becomes one.
Commit: a009301ae724bd2807cfa38a63b8f1df6c5fa095
https://github.com/Perl/perl5/commit/a009301ae724bd2807cfa38a63b8f1df6c5fa095
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M embed.fnc
M intrpvar.h
M locale.c
M proto.h
Log Message:
-----------
Make two locale PL_ strings const char*
This adds some compile safety to these.
Commit: 841330dd8cb5369eb520df9c8d5654d78ab172e5
https://github.com/Perl/perl5/commit/841330dd8cb5369eb520df9c8d5654d78ab172e5
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use a scratch buf; instead of resuing old
This is in preparation for the next commit
Commit: 621261b71d9067c940a1e386a2180f6c87fea589
https://github.com/Perl/perl5/commit/621261b71d9067c940a1e386a2180f6c87fea589
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 85353768fac4bd4a07dd3cf28832b7835b74b849
https://github.com/Perl/perl5/commit/85353768fac4bd4a07dd3cf28832b7835b74b849
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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.
If for some unlikely reason this fails, drop down to the existing code
that gets the code page from the locale name.
Commit: 160d89adc9c3bcb2f60c2740da139f6854185571
https://github.com/Perl/perl5/commit/160d89adc9c3bcb2f60c2740da139f6854185571
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 58c63b04c3e36143a8daee5f081f5f7d4791afca
https://github.com/Perl/perl5/commit/58c63b04c3e36143a8daee5f081f5f7d4791afca
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: baeea3b43874abca435ed0886bc9ae4b29b779ae
https://github.com/Perl/perl5/commit/baeea3b43874abca435ed0886bc9ae4b29b779ae
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 198d0716260fd8ffcd81c187e9433f66b220094a
https://github.com/Perl/perl5/commit/198d0716260fd8ffcd81c187e9433f66b220094a
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: ca0e80496fbdbcf7acc9979e027d44eb2ced75ff
https://github.com/Perl/perl5/commit/ca0e80496fbdbcf7acc9979e027d44eb2ced75ff
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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() will determine if the string it is passed
in the locale it is passed is to be treated as UTF-8, or not.
Commit: b1de6ea2abc74d69db344cb2f8ee9151841524d1
https://github.com/Perl/perl5/commit/b1de6ea2abc74d69db344cb2f8ee9151841524d1
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: abfdcb489b16bb63580918f8f45928a632b7ed9f
https://github.com/Perl/perl5/commit/abfdcb489b16bb63580918f8f45928a632b7ed9f
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 9ccbf8f9c095e1c2d537b02f28996b3ed4a72296
https://github.com/Perl/perl5/commit/9ccbf8f9c095e1c2d537b02f28996b3ed4a72296
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 1dd7ec66e441a127e731f6497dee92841d21cb86
https://github.com/Perl/perl5/commit/1dd7ec66e441a127e731f6497dee92841d21cb86
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 507070ce6be1b6aba83f536139831b88c1862252
https://github.com/Perl/perl5/commit/507070ce6be1b6aba83f536139831b88c1862252
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 5f62ef03802f4b96914468bf737b6146a2157423
https://github.com/Perl/perl5/commit/5f62ef03802f4b96914468bf737b6146a2157423
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: c3711b7731455054bd373c7f5780c0aadcdf67c6
https://github.com/Perl/perl5/commit/c3711b7731455054bd373c7f5780c0aadcdf67c6
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 2da258a9988f481bb65bb0cc088ab8b15b5c5be8
https://github.com/Perl/perl5/commit/2da258a9988f481bb65bb0cc088ab8b15b5c5be8
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use Strerror(), not strerror()
Commit: c140658012c49b70157cdc40dd8c527e6a448022
https://github.com/Perl/perl5/commit/c140658012c49b70157cdc40dd8c527e6a448022
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 365b073beff7bcfb6b1664039032e83b4d60d452
https://github.com/Perl/perl5/commit/365b073beff7bcfb6b1664039032e83b4d60d452
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: b1c023e15cef84d3cb8e133650c19db56900a58a
https://github.com/Perl/perl5/commit/b1c023e15cef84d3cb8e133650c19db56900a58a
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M embed.fnc
M embed.h
M locale.c
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: d6bc0222019005da2ef4fdd891d621b7ee2098c4
https://github.com/Perl/perl5/commit/d6bc0222019005da2ef4fdd891d621b7ee2098c4
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M mg.c
Log Message:
-----------
mg.c: White-space only
Indent newly formed block from the previous commit.
Commit: eb22fdd8cedc1e2ae6e929ce94d8f6d6dbd3878b
https://github.com/Perl/perl5/commit/eb22fdd8cedc1e2ae6e929ce94d8f6d6dbd3878b
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 82ca30bfcd5a2812223a91d0ec89593220b36c7d
https://github.com/Perl/perl5/commit/82ca30bfcd5a2812223a91d0ec89593220b36c7d
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 4322e7c71b6654556121aa0e0d96c9227c48390b
https://github.com/Perl/perl5/commit/4322e7c71b6654556121aa0e0d96c9227c48390b
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M embed.fnc
M locale.c
M perl.h
M proto.h
Log Message:
-----------
Add a common locale panic macro and function
This will make sure that all the necessary clean up gets done.
Commit: 77ea72a0b2c88234ce231f74c8fd3e28bc5e4d6e
https://github.com/Perl/perl5/commit/77ea72a0b2c88234ce231f74c8fd3e28bc5e4d6e
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: f927b35138fdb76e99aecb73ae5685ae1281c323
https://github.com/Perl/perl5/commit/f927b35138fdb76e99aecb73ae5685ae1281c323
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 2ef86598d3703e7998e8a16779915ed038070f71
https://github.com/Perl/perl5/commit/2ef86598d3703e7998e8a16779915ed038070f71
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: de51f5e38c6b0a32ba99fb2ca40144fbbfd43709
https://github.com/Perl/perl5/commit/de51f5e38c6b0a32ba99fb2ca40144fbbfd43709
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 1c6eba3502c50b31b6fef005a19a2588183779f7
https://github.com/Perl/perl5/commit/1c6eba3502c50b31b6fef005a19a2588183779f7
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: da00ab1ae654eff5b634bb425d6263e719f82e66
https://github.com/Perl/perl5/commit/da00ab1ae654eff5b634bb425d6263e719f82e66
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: f07522458a23f34a447e2f32aceb3a0c79189bcb
https://github.com/Perl/perl5/commit/f07522458a23f34a447e2f32aceb3a0c79189bcb
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: e36a797a92789f5edf63c18418f584513666a645
https://github.com/Perl/perl5/commit/e36a797a92789f5edf63c18418f584513666a645
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: b6bbc74eb8ff96a86b27f491adde3a1172ab8e4d
https://github.com/Perl/perl5/commit/b6bbc74eb8ff96a86b27f491adde3a1172ab8e4d
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
Log Message:
-----------
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: 202d0a1c58f1716fafaa6afe2a4a529d7025bd7a
https://github.com/Perl/perl5/commit/202d0a1c58f1716fafaa6afe2a4a529d7025bd7a
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add some asserts
Commit: 2fc42d100f46a324d851dce9a490752eb5958189
https://github.com/Perl/perl5/commit/2fc42d100f46a324d851dce9a490752eb5958189
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: f69bcc3118341b0b906819d68fea52897fdabceb
https://github.com/Perl/perl5/commit/f69bcc3118341b0b906819d68fea52897fdabceb
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 92f8d166e132edb6134a51f50cae3fe57f0fbcfb
https://github.com/Perl/perl5/commit/92f8d166e132edb6134a51f50cae3fe57f0fbcfb
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M embed.fnc
Log Message:
-----------
embed.fnc: White space only
Commit: 2db887d19fd36d6515ff533bfdbc50bec332ab81
https://github.com/Perl/perl5/commit/2db887d19fd36d6515ff533bfdbc50bec332ab81
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 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: 8aff6ba1a14f881e74b9b59a2424ac1d34b4b880
https://github.com/Perl/perl5/commit/8aff6ba1a14f881e74b9b59a2424ac1d34b4b880
Author: Karl Williamson <[email protected]>
Date: 2021-03-03 (Wed, 03 Mar 2021)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Change assert() into STATIC_ASSERT()
Compare: https://github.com/Perl/perl5/compare/c8755996f38b%5E...8aff6ba1a14f