Thread: Windows question: when is LC_MESSAGES defined?

Windows question: when is LC_MESSAGES defined?

From
Jeff Davis
Date:
I was trying to exercise the function IsoLocaleName(), which is
surrounded by:

   #if defined(WIN32) && defined(LC_MESSAGES)

but, at least in CI, that combination never seems to be true, which
surprised me. What platforms exercise this code path?

Regards,
    Jeff Davis




Re: Windows question: when is LC_MESSAGES defined?

From
Thomas Munro
Date:
On Thu, Jul 10, 2025 at 5:32 AM Jeff Davis <pgsql@j-davis.com> wrote:
> I was trying to exercise the function IsoLocaleName(), which is
> surrounded by:
>
>    #if defined(WIN32) && defined(LC_MESSAGES)
>
> but, at least in CI, that combination never seems to be true, which
> surprised me. What platforms exercise this code path?

.cirrus.tasks.yml says:

   # disable -Dnls as the number of files it creates cause a noticable
slowdown...

   configure_script: |
    %BASH% -c "meson setup -Ddebug=true -Doptimization=g
-Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled
-DTAR=%TAR% build"

If you turn that on then the next problem to solve is:

[03:28:24.318] Program msgfmt found: NO

It gets past that and enables NLS and compiles that code in the
optional MinGW build (assuming you enable it in meson).



Re: Windows question: when is LC_MESSAGES defined?

From
Thomas Munro
Date:
On Thu, Jul 10, 2025 at 3:45 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> [03:28:24.318] Program msgfmt found: NO

Correction, that ^ is the reason it's not reached on the MSVC task,
while -Dnls=disabled is the reason for the MinGW task.  But the
conclusion is the same: MinGW is the easiest way to test this code
on CI, if you're hacking on it.

Given that the build farm also doesn't test Windows + NLS, it's a
small miracle that it even compiles.  Hmm, I guess that the EDB
installer build must have it enabled, so I suppose they'd tell us if
we broke it.  I guess that because sometimes we see reports of
encoded-garbled error messages in other languages on the lists, which
also tells us that it might have bugs in that department.  What I
don't recall is whether they looked like the
"some-contexts-have-no-defined-encoding" problem (that exists on Unix
too but no one cares anymore since we all switched everything to UTF-8
ages ago), or something else...