public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* i686-w64-mingw32-gcc: LC_MESSAGES
@ 2019-01-08 21:26 Lee
  2019-01-09 10:21 ` JonY
  0 siblings, 1 reply; 9+ messages in thread
From: Lee @ 2019-01-08 21:26 UTC (permalink / raw)
  To: cygwin

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 .. ??


$ cat lcmessages.c
#include <stdio.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char **argv )
{
  char *s, *lang;
  lang = getenv("LANG");
  printf("  LANG=%s  initial locale: %s\n", lang, setlocale(LC_ALL, NULL));

  s = setlocale(LC_ALL, "");
  printf("after 'setlocale(LC_ALL, \"\");'                 locale=%s\n", s);
#ifdef LC_MESSAGES
  s = setlocale(LC_MESSAGES, "de_DE.utf8");
  printf("after 'setlocale(LC_MESSAGES, \"de_DE.utf8\");'
locale=%s\n", setlocale(LC_ALL, NULL));
#else
  printf("LC_MESSAGES is not defined\n");
#endif
}

$ gcc lcmessages.c

$ ./a
  LANG=en_US.UTF-8  initial locale: C
after 'setlocale(LC_ALL, "");'
locale=C/en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/en_US.UTF-8
after 'setlocale(LC_MESSAGES, "de_DE.utf8");'
locale=C/en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/de_DE.utf8

$ i686-w64-mingw32-gcc lcmessages.c

$ ./a
  LANG=en_US.UTF-8  initial locale: C
after 'setlocale(LC_ALL, "");'                 locale=English_United States.1252
LC_MESSAGES is not defined

Thanks,
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-01-10  0:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 21:26 i686-w64-mingw32-gcc: LC_MESSAGES 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
2019-01-09 23:43         ` JonY
2019-01-10  0:51           ` Lee

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).