Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 7bc020dea5befba1149612fa3fd8220c10b51dec
      
https://github.com/Perl/perl5/commit/7bc020dea5befba1149612fa3fd8220c10b51dec
  Author: Karl Williamson <k...@cpan.org>
  Date:   2024-01-02 (Tue, 02 Jan 2024)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Refactor an #ifdef

I have some #ifdef'd code that when enabled makes the locale handling
think it's running on a Windows MingW machine.  It doesn't emulate the
whole platform by any means, but it does reproduce the different logic
that is required for Windows in locale.c, and allows checking that
changes made likely will compile there without having to actually go to
a Windows machine.

It is mostly hidden from the rest of the code, except in the one spot
where it gets set up.  This makes it unobtrusive, but more importantly
maximizes the chances of it faithfully doing what Windows would do.

But there are two places in locale.c where I couldn't completely hide
it.  One is in teardown to avoid a leak, and the other is this spot in
the code where the codeset names are calculated.  There are big
differences in the Windows name syntax (integers) from the POSIX ones
(character strings).

This commit uses a macro to convert the integers into strings, so that
the required #ifdef doesn't interrupt the logic flow.


Reply via email to