bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: localename on mingw


From: Bruno Haible
Subject: Re: localename on mingw
Date: Sat, 05 May 2018 10:27:31 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-119-generic; KDE/5.18.0; x86_64; ; )

Eli Zaretskii wrote:
> my conclusion was that
> Gnulib does want those internal functions to serve some useful
> purpose, perhaps for future extensions or for Gnulib code other that
> gl_locale_name

Correct. These functions are exposed in localename.h. If someone finds
them useful, they can use them.

> So I preferred to leave the test suite factored
> as it was, and instead make sure each one of those functions produced
> a meaningful value.

Yes, it was good to not remove two functions that are declared in
localename.h.

> > The test failures occur because the distinction between what happens
> > in gl_locale_name_thread and gl_locale_name_posix is visible
> > to the test suite.
> 
> Can you elaborate about this distinction and how it is visible in the
> test suite?

There were two test failures:
  - line 158: because in some cases, gl_locale_name() returns a string
    without charset suffix. One could fix this by using the same logic
    as in localcharset.c, but I left it as-is because the primary purpose
    of gl_locale_name() is not the charset suffix.
  - line 480: The test suite encodes the implication "uselocale() was
    never called => gl_locale_name_thread() is NULL". Rather than removing
    this assertion, I preferred to refactor the code so that this assertion
    holds again.

> Cons (3): gl_locale_name_thread is useless on Windows.

No, this is not a 'Cons (3)'. It is perfectly OK to have a function that
returns NULL.

Also look at these descriptions in localename.h:

  gl_locale_name_thread
    Determine the current per-thread locale's name, as specified by uselocale()
    calls.

  gl_locale_name_posix
    Determine the thread-independent current locale's name, as specified by
    setlocale() calls or by environment variables.

My refactoring made the code on Windows match these descriptions.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]