Branch: refs/heads/smoke-me/khw-locale
  Home:   https://github.com/Perl/perl5
  Commit: 156cb30a3434138b4729e0a9c6ed21b7fab12be2
      
https://github.com/Perl/perl5/commit/156cb30a3434138b4729e0a9c6ed21b7fab12be2
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 903931ea854bc0d150b88dafe6842c8dc2e2fd95
      
https://github.com/Perl/perl5/commit/903931ea854bc0d150b88dafe6842c8dc2e2fd95
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M mg.c

  Log Message:
  -----------
  XXX better message: mg.c: Silence compiler warning


  Commit: 849fa77eb03bdaf5f48c27672d1e4c656e3f6246
      
https://github.com/Perl/perl5/commit/849fa77eb03bdaf5f48c27672d1e4c656e3f6246
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M lib/locale_threads.t

  Log Message:
  -----------
  XXX locale_threads


  Commit: 5438436f1ce32c9d3c20c7830b7be23bd3dfd6af
      
https://github.com/Perl/perl5/commit/5438436f1ce32c9d3c20c7830b7be23bd3dfd6af
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 4c9930aa7ea35fe61d331218fc2b7e171ec82c20
      
https://github.com/Perl/perl5/commit/4c9930aa7ea35fe61d331218fc2b7e171ec82c20
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 3db4307dbbc211032813b15dafe748485d78dc72
      
https://github.com/Perl/perl5/commit/3db4307dbbc211032813b15dafe748485d78dc72
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 9deea0b26d3cd3ea639c5d06af1610dc5a153363
      
https://github.com/Perl/perl5/commit/9deea0b26d3cd3ea639c5d06af1610dc5a153363
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: f1d852034dd2e955f74a5542ec1d2fb790f6e9b9
      
https://github.com/Perl/perl5/commit/f1d852034dd2e955f74a5542ec1d2fb790f6e9b9
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M handy.h

  Log Message:
  -----------
  handy.h: White-space, comment only


  Commit: 109135659547e8365cc5e5a49bf70a581f286c34
      
https://github.com/Perl/perl5/commit/109135659547e8365cc5e5a49bf70a581f286c34
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: a899f4895f069f7ac1679db13dd42f90ea0f5181
      
https://github.com/Perl/perl5/commit/a899f4895f069f7ac1679db13dd42f90ea0f5181
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 9450b70c1d69bea51f324d92f68c1d7069f6d871
      
https://github.com/Perl/perl5/commit/9450b70c1d69bea51f324d92f68c1d7069f6d871
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: c3bca7373c3b0c09d8870b52b560580124c1904c
      
https://github.com/Perl/perl5/commit/c3bca7373c3b0c09d8870b52b560580124c1904c
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: d665a20f126291e3d6c980d12b9f92c373f664f7
      
https://github.com/Perl/perl5/commit/d665a20f126291e3d6c980d12b9f92c373f664f7
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 634b857671d5fb6b61dd84445dd06a2c93cfec92
      
https://github.com/Perl/perl5/commit/634b857671d5fb6b61dd84445dd06a2c93cfec92
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 555a3a7028d997aa663ec97686c402df782d0ae3
      
https://github.com/Perl/perl5/commit/555a3a7028d997aa663ec97686c402df782d0ae3
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Declare three static arrays to be so.


  Commit: d8f57f001287e7779f3b4ca6bdaa103f00a7af00
      
https://github.com/Perl/perl5/commit/d8f57f001287e7779f3b4ca6bdaa103f00a7af00
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: c26c63386c5f80f52e1eb1fac4c8ec4cfcd73629
      
https://github.com/Perl/perl5/commit/c26c63386c5f80f52e1eb1fac4c8ec4cfcd73629
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: a57f82453b081054b02dd911ef23c83bfad7befe
      
https://github.com/Perl/perl5/commit/a57f82453b081054b02dd911ef23c83bfad7befe
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 308e7aea64d09292b57d4f711d261a3eb2a2054b
      
https://github.com/Perl/perl5/commit/308e7aea64d09292b57d4f711d261a3eb2a2054b
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: f4639b1fe5be986662c4ba66d39bfda8eb3949bd
      
https://github.com/Perl/perl5/commit/f4639b1fe5be986662c4ba66d39bfda8eb3949bd
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 1519a932b7323c302c8ee738c8742d6b7751ceb9
      
https://github.com/Perl/perl5/commit/1519a932b7323c302c8ee738c8742d6b7751ceb9
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 014ead9dbae878a8740ecaccb1dd41dd122896c1
      
https://github.com/Perl/perl5/commit/014ead9dbae878a8740ecaccb1dd41dd122896c1
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 695217768ea15b467ac88347bc5de4287e278f87
      
https://github.com/Perl/perl5/commit/695217768ea15b467ac88347bc5de4287e278f87
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 74a8ba2b95909e380466508a852712c3aae992d4
      
https://github.com/Perl/perl5/commit/74a8ba2b95909e380466508a852712c3aae992d4
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: ae0711ca123acd8c7338cc71dc1a8d9ac1d409be
      
https://github.com/Perl/perl5/commit/ae0711ca123acd8c7338cc71dc1a8d9ac1d409be
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 2ac169c07a42e7563bdbfd9973ba15787899ae56
      
https://github.com/Perl/perl5/commit/2ac169c07a42e7563bdbfd9973ba15787899ae56
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 8bf5ae683c8f4484abc92bcda7c330dfc7f32197
      
https://github.com/Perl/perl5/commit/8bf5ae683c8f4484abc92bcda7c330dfc7f32197
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 723aeb05a2f18c8f3f8f133334d0b875343e9efc
      
https://github.com/Perl/perl5/commit/723aeb05a2f18c8f3f8f133334d0b875343e9efc
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: b70d159aebdec7e86622a73df604def21e449248
      
https://github.com/Perl/perl5/commit/b70d159aebdec7e86622a73df604def21e449248
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 26dc0e1b6219110d34358c71bbc5242bfbc95721
      
https://github.com/Perl/perl5/commit/26dc0e1b6219110d34358c71bbc5242bfbc95721
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: edeac8e8f3c047c42c239bad325af0d8613a7035
      
https://github.com/Perl/perl5/commit/edeac8e8f3c047c42c239bad325af0d8613a7035
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 8649c1b06da5ec010017044f242895c5f4e53b78
      
https://github.com/Perl/perl5/commit/8649c1b06da5ec010017044f242895c5f4e53b78
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 51efb92fc2d5fa6fa00d954f4948756b16b85b82
      
https://github.com/Perl/perl5/commit/51efb92fc2d5fa6fa00d954f4948756b16b85b82
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 8186a984a28beeefe30f901110e51f236d668ceb
      
https://github.com/Perl/perl5/commit/8186a984a28beeefe30f901110e51f236d668ceb
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 670cacb162d7044e885b0f25d339df588cf13bb5
      
https://github.com/Perl/perl5/commit/670cacb162d7044e885b0f25d339df588cf13bb5
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 5ad74d91d36b7c2120aa47119f7645e90ba7057f
      
https://github.com/Perl/perl5/commit/5ad74d91d36b7c2120aa47119f7645e90ba7057f
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: d87afd6e9d574cca0b399a99a2f369980dcdb4fe
      
https://github.com/Perl/perl5/commit/d87afd6e9d574cca0b399a99a2f369980dcdb4fe
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: a2df5cf59010c462807fe92a3d46175f24c5648c
      
https://github.com/Perl/perl5/commit/a2df5cf59010c462807fe92a3d46175f24c5648c
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: c7314593a7d7dc5aea1365ae6fba03520114d64b
      
https://github.com/Perl/perl5/commit/c7314593a7d7dc5aea1365ae6fba03520114d64b
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 0a0d491a0631eda4d0782e60de7b1f5e59559620
      
https://github.com/Perl/perl5/commit/0a0d491a0631eda4d0782e60de7b1f5e59559620
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 33ff1b8cd4c5841e8a282b1f4536f17a9e85812c
      
https://github.com/Perl/perl5/commit/33ff1b8cd4c5841e8a282b1f4536f17a9e85812c
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: b173e0964c53d0368ebd94581072e7a4e945b45a
      
https://github.com/Perl/perl5/commit/b173e0964c53d0368ebd94581072e7a4e945b45a
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: abcc37ebad2488c154fd53bfca5009c8d6348567
      
https://github.com/Perl/perl5/commit/abcc37ebad2488c154fd53bfca5009c8d6348567
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 087e99bb0d16cc12815b7be04e5bc92e56c18b7f
      
https://github.com/Perl/perl5/commit/087e99bb0d16cc12815b7be04e5bc92e56c18b7f
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 898f1a3b77fcd74da38aac0f3225cdd084c68996
      
https://github.com/Perl/perl5/commit/898f1a3b77fcd74da38aac0f3225cdd084c68996
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 80f8fa1cc63fc4435be883fb401b03138bff6d7d
      
https://github.com/Perl/perl5/commit/80f8fa1cc63fc4435be883fb401b03138bff6d7d
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 17e67b5c867f82bda05ee0b4bf7a9b5e0a79ba8a
      
https://github.com/Perl/perl5/commit/17e67b5c867f82bda05ee0b4bf7a9b5e0a79ba8a
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 3baf1094fe921aec0e906b38b03c00e04193638b
      
https://github.com/Perl/perl5/commit/3baf1094fe921aec0e906b38b03c00e04193638b
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 4f29f8be020d8b8d4490abb14d0f85ef0ae03b46
      
https://github.com/Perl/perl5/commit/4f29f8be020d8b8d4490abb14d0f85ef0ae03b46
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 619491228a16b7cc25ed05ceb5cddc1602c2a1e6
      
https://github.com/Perl/perl5/commit/619491228a16b7cc25ed05ceb5cddc1602c2a1e6
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: c111c31006e77dbd06969e5e8a080f131d487694
      
https://github.com/Perl/perl5/commit/c111c31006e77dbd06969e5e8a080f131d487694
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: e604b5a11648cfa3a92e05f3838956f153d93a5a
      
https://github.com/Perl/perl5/commit/e604b5a11648cfa3a92e05f3838956f153d93a5a
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 0ea343e7ee6133fc69d9f77afcbe7e2aee785c5e
      
https://github.com/Perl/perl5/commit/0ea343e7ee6133fc69d9f77afcbe7e2aee785c5e
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: f15c781d84a2576bfe3908262d017e0fdaf9f55c
      
https://github.com/Perl/perl5/commit/f15c781d84a2576bfe3908262d017e0fdaf9f55c
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: ae12149a765a6f70260b7f9bcbdee23419c6154c
      
https://github.com/Perl/perl5/commit/ae12149a765a6f70260b7f9bcbdee23419c6154c
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M ext/POSIX/POSIX.xs

  Log Message:
  -----------
  POSIX.xs: White-space only

Properly indent some nested preprocessor directives


  Commit: e7587c2fafee6d4d74f9e06c8ea9758998b089aa
      
https://github.com/Perl/perl5/commit/e7587c2fafee6d4d74f9e06c8ea9758998b089aa
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 606d69dc1eb64b5ee5050c0a656e161df76a644d
      
https://github.com/Perl/perl5/commit/606d69dc1eb64b5ee5050c0a656e161df76a644d
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 19d3f8cf73df3a7cd0637f22bbe1fce326e346fd
      
https://github.com/Perl/perl5/commit/19d3f8cf73df3a7cd0637f22bbe1fce326e346fd
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 4e41a08e2d188801285f0e618dbe6c1def861a61
      
https://github.com/Perl/perl5/commit/4e41a08e2d188801285f0e618dbe6c1def861a61
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 7120eede5c2440b962dc3786344c1600c31ca204
      
https://github.com/Perl/perl5/commit/7120eede5c2440b962dc3786344c1600c31ca204
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 1fa75f559a03e79a746d1c499cee1134d3a2aaaf
      
https://github.com/Perl/perl5/commit/1fa75f559a03e79a746d1c499cee1134d3a2aaaf
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 22d4f5e5827c77225bd4fa8533affb1c5eabe350
      
https://github.com/Perl/perl5/commit/22d4f5e5827c77225bd4fa8533affb1c5eabe350
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: d8b973f1483bb9ac94cd356c189887127aeffe07
      
https://github.com/Perl/perl5/commit/d8b973f1483bb9ac94cd356c189887127aeffe07
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 9ffac311d9a7184322ff753b249edfca98818368
      
https://github.com/Perl/perl5/commit/9ffac311d9a7184322ff753b249edfca98818368
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Use typedef to simplify

This allows some preprocessor conditionals to be removed


  Commit: 1a288b1bac973c7643c2ab5f7601303d5cab0297
      
https://github.com/Perl/perl5/commit/1a288b1bac973c7643c2ab5f7601303d5cab0297
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Rmv redundant cBOOL()

strEQ and && already return booleans


  Commit: 14785c7862b943e39f2a27b8abc67df921bfbfc6
      
https://github.com/Perl/perl5/commit/14785c7862b943e39f2a27b8abc67df921bfbfc6
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: e02be37b7e7d8ce310e5306ee4d10fb376f50e1a
      
https://github.com/Perl/perl5/commit/e02be37b7e7d8ce310e5306ee4d10fb376f50e1a
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: d292b5ba9c918153c9f8180511fdc4929e933601
      
https://github.com/Perl/perl5/commit/d292b5ba9c918153c9f8180511fdc4929e933601
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 8118f3f6d7a85b6c7bc7c8a217a60ecf201009aa
      
https://github.com/Perl/perl5/commit/8118f3f6d7a85b6c7bc7c8a217a60ecf201009aa
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: f77db6c02da473c23bbca97a756975ca8ed8400b
      
https://github.com/Perl/perl5/commit/f77db6c02da473c23bbca97a756975ca8ed8400b
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: b6b8c37aee0f70bfe44c020bb86285186af1e2ea
      
https://github.com/Perl/perl5/commit/b6b8c37aee0f70bfe44c020bb86285186af1e2ea
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: fb66ee4aeac3882d17e5a59c9ff8b4747b9d245f
      
https://github.com/Perl/perl5/commit/fb66ee4aeac3882d17e5a59c9ff8b4747b9d245f
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: ce1b67c0d33c009887a23b395e2c8920fdd3868e
      
https://github.com/Perl/perl5/commit/ce1b67c0d33c009887a23b395e2c8920fdd3868e
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: b5c463e993e8a447815c39e18d140746285a02f5
      
https://github.com/Perl/perl5/commit/b5c463e993e8a447815c39e18d140746285a02f5
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: cd11537f9e7c567f6db9647b9ca6a4b6feb6ecb2
      
https://github.com/Perl/perl5/commit/cd11537f9e7c567f6db9647b9ca6a4b6feb6ecb2
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 35206cacf82a6b54f92d94e237aeba06a5702e49
      
https://github.com/Perl/perl5/commit/35206cacf82a6b54f92d94e237aeba06a5702e49
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 02131f023fdd0ae331e560f0375c6f7a958ff5a9
      
https://github.com/Perl/perl5/commit/02131f023fdd0ae331e560f0375c6f7a958ff5a9
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: dab672649ba4206e1dbe9d860f14f88a51002607
      
https://github.com/Perl/perl5/commit/dab672649ba4206e1dbe9d860f14f88a51002607
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 247548090cfb5b25f1fb83546445eb2d42fbbaa4
      
https://github.com/Perl/perl5/commit/247548090cfb5b25f1fb83546445eb2d42fbbaa4
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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_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: 87a7ec47756a1f1d8a0d42a94633e900379f5494
      
https://github.com/Perl/perl5/commit/87a7ec47756a1f1d8a0d42a94633e900379f5494
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 588e918c3bd6f3412f66bd1c7ff7ff54e98d5a2b
      
https://github.com/Perl/perl5/commit/588e918c3bd6f3412f66bd1c7ff7ff54e98d5a2b
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 6ec7204b1137076485adb63c9aa2cfc2eb6b7edf
      
https://github.com/Perl/perl5/commit/6ec7204b1137076485adb63c9aa2cfc2eb6b7edf
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 561f8ddd5503579598f13833ab9b644a0910aaf1
      
https://github.com/Perl/perl5/commit/561f8ddd5503579598f13833ab9b644a0910aaf1
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: f62fa5ad8bd623b6620cc9a3ef06611c56a385eb
      
https://github.com/Perl/perl5/commit/f62fa5ad8bd623b6620cc9a3ef06611c56a385eb
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 5fd3adfee109295602b763f710ce4e92bc5dc6b2
      
https://github.com/Perl/perl5/commit/5fd3adfee109295602b763f710ce4e92bc5dc6b2
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 6721ef797786d51fc17ad663efd86bb08d0a3484
      
https://github.com/Perl/perl5/commit/6721ef797786d51fc17ad663efd86bb08d0a3484
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 4b078f34cbd33e475ac6aeb6592148dc8376c43b
      
https://github.com/Perl/perl5/commit/4b078f34cbd33e475ac6aeb6592148dc8376c43b
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Use Strerror(), not strerror()


  Commit: 3e5334d044ee8a3b04eebb180392fffed0d4be4b
      
https://github.com/Perl/perl5/commit/3e5334d044ee8a3b04eebb180392fffed0d4be4b
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 0a0c44f890f33283891e60bcf04477f6378dedf6
      
https://github.com/Perl/perl5/commit/0a0c44f890f33283891e60bcf04477f6378dedf6
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 8020855cddad85dc82396b377fbad98657f8f2ac
      
https://github.com/Perl/perl5/commit/8020855cddad85dc82396b377fbad98657f8f2ac
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 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: d340456dc3ba5dc0f5d63e44fe9fb9da23ef1e5a
      
https://github.com/Perl/perl5/commit/d340456dc3ba5dc0f5d63e44fe9fb9da23ef1e5a
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M mg.c

  Log Message:
  -----------
  mg.c: White-space only

Indent newly formed block from the previous commit.


  Commit: 9d63965a0a05f30a3e89a2ff00e8907457c09e78
      
https://github.com/Perl/perl5/commit/9d63965a0a05f30a3e89a2ff00e8907457c09e78
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: e7811dc1faa3bb57e77f7f0bdf9e9399dd220def
      
https://github.com/Perl/perl5/commit/e7811dc1faa3bb57e77f7f0bdf9e9399dd220def
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 09d60a4552b1afe6c6d7ccad7b077a889debef9b
      
https://github.com/Perl/perl5/commit/09d60a4552b1afe6c6d7ccad7b077a889debef9b
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 56d25294172d2bf552486cfd7df43f1c3b13e3c3
      
https://github.com/Perl/perl5/commit/56d25294172d2bf552486cfd7df43f1c3b13e3c3
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: a1e18ef3f1af39b895983be76a43e9502e49da33
      
https://github.com/Perl/perl5/commit/a1e18ef3f1af39b895983be76a43e9502e49da33
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 29a873723f16ce089ca14d63242972c88b976e64
      
https://github.com/Perl/perl5/commit/29a873723f16ce089ca14d63242972c88b976e64
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 754b1067cb28255fa2de1c7d10dafdfdbb8971f5
      
https://github.com/Perl/perl5/commit/754b1067cb28255fa2de1c7d10dafdfdbb8971f5
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 16e083e442daa8c9f50bdf014c1586ccfb17bfbd
      
https://github.com/Perl/perl5/commit/16e083e442daa8c9f50bdf014c1586ccfb17bfbd
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: b7a3ab997adf3605c98e476066d5d9974731a480
      
https://github.com/Perl/perl5/commit/b7a3ab997adf3605c98e476066d5d9974731a480
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 4916de5226a5ed2bccdea7849656e87b5f5a41d9
      
https://github.com/Perl/perl5/commit/4916de5226a5ed2bccdea7849656e87b5f5a41d9
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 2dabe6eca561b53efa66841a6ce15a46e7e09acd
      
https://github.com/Perl/perl5/commit/2dabe6eca561b53efa66841a6ce15a46e7e09acd
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: 94662ee519e445676f21e08c03143b36fb46bce0
      
https://github.com/Perl/perl5/commit/94662ee519e445676f21e08c03143b36fb46bce0
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: b3c60fc32bf15ec840185b2f2aace70cb5f87f96
      
https://github.com/Perl/perl5/commit/b3c60fc32bf15ec840185b2f2aace70cb5f87f96
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Add some asserts


  Commit: 054f6a6ef1c6f80606457d2730dee7f72b1f0dcc
      
https://github.com/Perl/perl5/commit/054f6a6ef1c6f80606457d2730dee7f72b1f0dcc
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: c93b52016f3d010d693c22255aa9c4a46c61254a
      
https://github.com/Perl/perl5/commit/c93b52016f3d010d693c22255aa9c4a46c61254a
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: c30b72ada9c05b8138ba7c029e73ce1ed8de61cc
      
https://github.com/Perl/perl5/commit/c30b72ada9c05b8138ba7c029e73ce1ed8de61cc
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 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: fcc63857f02e40016727dc07d87df58ae1462581
      
https://github.com/Perl/perl5/commit/fcc63857f02e40016727dc07d87df58ae1462581
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Change assert() into STATIC_ASSERT()


  Commit: 51ba76da5266ec8391c0d3f4a77bf1cbfb58988d
      
https://github.com/Perl/perl5/commit/51ba76da5266ec8391c0d3f4a77bf1cbfb58988d
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M dosish.h
    M unixish.h

  Log Message:
  -----------
  Unixish.sh, doshish.sh: 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: 09e8f5934713332f699427ccc2683fb9d41a6cb5
      
https://github.com/Perl/perl5/commit/09e8f5934713332f699427ccc2683fb9d41a6cb5
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M perl.h

  Log Message:
  -----------
  perl.h: Clarify debugging msg for locales

ThI wrote this years ago, and now have discovered it was written
assuming the consumer is more familiar with the underlying code than
warranted.


  Commit: 99716bbec7d7268e1cf092d59e01ea19f58280e0
      
https://github.com/Perl/perl5/commit/99716bbec7d7268e1cf092d59e01ea19f58280e0
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  temp? Extra debugging


  Commit: e5ebf24a778b10584f9caccda368c77005d6f881
      
https://github.com/Perl/perl5/commit/e5ebf24a778b10584f9caccda368c77005d6f881
  Author: Karl Williamson <[email protected]>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M Configure
    M config_h.SH
    M lib/locale_threads.t
    M locale.c
    M metaconfig.h
    M t/test.pl
    M uconfig.h

  Log Message:
  -----------
  l


Compare: https://github.com/Perl/perl5/compare/af22eaa9fdca...e5ebf24a778b

Reply via email to