public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Lee <ler762@gmail.com>
To: cygwin@cygwin.com
Subject: Re: i686-w64-mingw32-gcc: LC_MESSAGES
Date: Thu, 10 Jan 2019 00:07:00 -0000	[thread overview]
Message-ID: <CAD8GWst3657zmrgRQhc4+4Vj3uR0YYfeUnaxVTLZ51GNJ-jXVw@mail.gmail.com> (raw)
In-Reply-To: <7fca2500-d62e-e251-c832-bb6bf2b5f03d@SystematicSw.ab.ca>

On 1/9/19, Brian Inglis  wrote:
>
> On 2019-01-09 12:43, Lee wrote:
>> On 1/9/19, Douglas Coup  wrote:
>>>
>>> On 1/9/2019 1:14 PM, Lee wrote:
>>>> On 1/9/19, JonY  wrote:
>>>>> On 1/8/19 9:26 PM, Lee wrote:
>>>>>> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html
>>>>>> has a note for LC_MESSAGES:
>>>>>> The functionality described is an extension to the ISO C standard.
>>>>>> Application developers may make use of an extension as it is
>>>>>> supported on all POSIX.1-2017-conforming systems.
>>>>>> i686-w64-mingw32-gcc doesn't have LC_MESSAGES defined.
>>>>>> Is that an oversight, something missing in windows, or .. ??
>>>>> Windows MSVCR isn't POSIX nor ISO C compliant, so you shouldn't be
>>>>> referring to opengroups, only against MSDN.
>>>> What's a Windows MSVCR?
>>>> Since the same program compiled with cygwins' gcc has LC_MESSAGES
>>>> defined, I was guessing it was just a library thing and maybe it just
>>>> hadn't been implemented in the mingw libraries yet.. but it sounds
>>>> like it's not an oversight & Microsoft needs to support LC_MESSAGES
>>>> before i686-w64-mingw32-gcc will.  Is that about right?
>>> MSVCR = MicroSoft Visual C Run-time (I think)
>> Meaning i686-w64-mingw32-gcc uses the Microsoft libraries vs. cygwin
>> gcc using posix compliant libraries?  Implying LC_MESSAGES not being
>> defined is yet another instance of Microsoft not following accepted
>> standards?
>> The background for my question is
>> https://github.com/htacg/tidy-html5/issues/770
>> Tidy removed the setlocale call from the library init function, so if
>> users want a specific locale/language they're going to have to set it
>> up themselves.
>> I'd like to update the tidylib example code showing how to set the
>> language, but
>>   setlocale(LC_ALL, "");
>>   tidySetLanguage( setlocale(LC_MESSAGES, NULL) );
>> probably isn't a good example if LC_MESSAGES is missing on some systems.
>
> You have to convert your messages to Windows message resources in your
> build, then link and package Windows message resources with non-POSIX
> compliant exes, or add a POSIX message implementation to your exes.

I'm just trying to come up with example code for how to set the locale
& language in the tidylib documentation; thankfully, me building a
native windows version of tidy isn't the goal..  I was just trying out
code that worked under cygwin & was a bit surprised it wouldn't even
compile for windows.  But it seems to be a windows limitation, so
[snip snarky comment]

Regards,
Lee

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2019-01-10  0:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08 21:26 Lee
2019-01-09 10:21 ` JonY
2019-01-09 18:14   ` Lee
2019-01-09 18:19     ` Douglas Coup
2019-01-09 19:43       ` Lee
2019-01-09 23:41         ` Brian Inglis
2019-01-10  0:07           ` Lee [this message]
2019-01-09 23:43         ` JonY
2019-01-10  0:51           ` Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD8GWst3657zmrgRQhc4+4Vj3uR0YYfeUnaxVTLZ51GNJ-jXVw@mail.gmail.com \
    --to=ler762@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).