Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: fe1c14942b81da8e421933b78e87d61c3cfbaafb
      
https://github.com/Perl/perl5/commit/fe1c14942b81da8e421933b78e87d61c3cfbaafb
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: 54ddc3dd881af3e418db218de9030d173f7bfbe6
      
https://github.com/Perl/perl5/commit/54ddc3dd881af3e418db218de9030d173f7bfbe6
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Move fcn within file

This is for later commits which will change it to rely on new defines
that won't occur until later in the file than its current position


  Commit: 935c09ec7e930bf019be3c3a16d8585a7033acbd
      
https://github.com/Perl/perl5/commit/935c09ec7e930bf019be3c3a16d8585a7033acbd
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: 0063a6bf0c713aa319cf86b07cfae971a194fa9e
      
https://github.com/Perl/perl5/commit/0063a6bf0c713aa319cf86b07cfae971a194fa9e
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Outdent previous commit

The previous commit kept the indentation level the same as it moved code
to a new function, even though an outer block was stripped off in the
process.  This was to minimize diff output.  This commit is white space
only.


  Commit: db30913c80db7a48dc75ee50bf3a4d97e1aaf870
      
https://github.com/Perl/perl5/commit/db30913c80db7a48dc75ee50bf3a4d97e1aaf870
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: f996b1305c367d3105bf691f164e5ef995237b5c
      
https://github.com/Perl/perl5/commit/f996b1305c367d3105bf691f164e5ef995237b5c
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: a683a66af6c3842318beaa422f943ea8613f20f3
      
https://github.com/Perl/perl5/commit/a683a66af6c3842318beaa422f943ea8613f20f3
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: 9b271b938aa912acb412cc7d05bf7a460ef1ddf0
      
https://github.com/Perl/perl5/commit/9b271b938aa912acb412cc7d05bf7a460ef1ddf0
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: 434e00693938d5f830238753e8963f36e1f7dd4a
      
https://github.com/Perl/perl5/commit/434e00693938d5f830238753e8963f36e1f7dd4a
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: 3980cddbd2d5dbb02a7ff4b5b3f6d40187ea6b47
      
https://github.com/Perl/perl5/commit/3980cddbd2d5dbb02a7ff4b5b3f6d40187ea6b47
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: 94202fb81e1987cdd3326f647d94de8af15c63ad
      
https://github.com/Perl/perl5/commit/94202fb81e1987cdd3326f647d94de8af15c63ad
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: c7dc1ea8f2e8d3c4ec322e7fc2154bd801049902
      
https://github.com/Perl/perl5/commit/c7dc1ea8f2e8d3c4ec322e7fc2154bd801049902
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: 0bb379424f96daa3b0e41d5183447145c926b52d
      
https://github.com/Perl/perl5/commit/0bb379424f96daa3b0e41d5183447145c926b52d
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: 996e6b9e17bebd710ff658cdb123da073ac0ee97
      
https://github.com/Perl/perl5/commit/996e6b9e17bebd710ff658cdb123da073ac0ee97
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: 458cddf75c7800dff8bab4f28518e96bd49068aa
      
https://github.com/Perl/perl5/commit/458cddf75c7800dff8bab4f28518e96bd49068aa
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  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: e8d6380f3c8d4c6fe35b0b138074c5cf1bc7fc17
      
https://github.com/Perl/perl5/commit/e8d6380f3c8d4c6fe35b0b138074c5cf1bc7fc17
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  Changed paths:
    M perl.h

  Log Message:
  -----------
  perl.h: Expand scope of cpp conditional

This just doesn't bother with checking some locale-related stuff if not
paying attention to locales.


  Commit: 67c13e2e5256433627bc730868b4e550f5a4b5f9
      
https://github.com/Perl/perl5/commit/67c13e2e5256433627bc730868b4e550f5a4b5f9
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  Changed paths:
    M locale.c
    M perl.h

  Log Message:
  -----------
  locale.c: Create new convenience macro

glibc doesn't have the querylocale() function, available on some other
platforms, such as Darwin and *BSD.  However, it instead has the
equivalent functionality available through an undocumented feature.

This commit allows someone in the know to compile perl to use that
feature, and wraps its API with a macro so that the calling code doesn't
have to be aware of the different APIs of the two methods.

That macro's definition is now done in perl.h, as future commits will
use it in other files.

Since this is an undocumented feature, I am not currently documenting
this wrapper availability.  However, it has been used in the field
without complaint for a couple of releases, as follows:  A more
cumbersome substitute method continues to be used to get what it does.
But in the past both methods were tried and the program died if they
yielded different results.  Since no one has complained, I'm fairly
confident it works.  But sill I'm deferring its more general use.


  Commit: d92b203c3251254039d9cb3b314646b5e894c21c
      
https://github.com/Perl/perl5/commit/d92b203c3251254039d9cb3b314646b5e894c21c
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  Changed paths:
    M embed.fnc
    M embed.h
    M intrpvar.h
    M locale.c
    M proto.h

  Log Message:
  -----------
  locale.c: querylocale() doesn't work on LC_ALL

I had misread the man pages.  This bug has been in the field for several
releases now, but most likely hasn't shown up because it's almost always
the case that the locale categories will be set to the same locale.  And
so most implementations of querylocale() would return the correct
result.

This commit works by splitting the calculation of the value of LC_ALL
from S_emulate_setlocale_i() into a separate function, and extending it
to work on querylocale() systems.  This has the added benefit of
removing tangential code from the main line, making
S_emulate_setlocale_i easier to read.

calculate_LC_ALL() is the new function, and is now called from two
places.  As part of this commit, constness is added to PL_curlocales[]

Part of this change is to keep our records of LC_ALL on non-querylocale
systems always up-to-date, which is better practice

And part of this change is temporary, marked as such, to be removed a
few commits later.


  Commit: b0fb28a3e3d7c4beb9670ea506d1f3c8b30bf9a1
      
https://github.com/Perl/perl5/commit/b0fb28a3e3d7c4beb9670ea506d1f3c8b30bf9a1
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c Make a char * variable const

A future commit will want this


Compare: https://github.com/Perl/perl5/compare/5bdad801a718...b0fb28a3e3d7

Reply via email to