+2011-02-11 Bruno Haible <bruno@clisp.org>
+
+ Prepare for locale dependent tests on mingw.
+ * m4/locale-ar.m4 (gt_LOCALE_AR): On native Windows, call setlocale
+ differently.
+ * m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise.
+ * m4/locale-ja.m4 (gt_LOCALE_JA): Likewise.
+ * m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise.
+ * m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.
+
2011-02-11 Eric Blake <eblake@redhat.com>
strptime: avoid compiler warnings
-# locale-ar.m4 serial 2
+# locale-ar.m4 serial 3
dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
char buf[16];
int main () {
/* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ /* On native Win32, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+#else
if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
/* Check that nl_langinfo(CODESET) is nonempty and not "ASCII" or "646"
and ends in "6". */
#if HAVE_LANGINFO_CODESET
-# locale-fr.m4 serial 12
+# locale-fr.m4 serial 13
dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
char buf[16];
int main () {
/* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ /* On native Win32, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+#else
if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
variables, and all locales use the UTF-8 encoding. */
#if !(defined __BEOS__ || defined __HAIKU__)
/* Check whether the given locale name is recognized by the system. */
+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ /* On native Win32, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-# locale-ja.m4 serial 8
+# locale-ja.m4 serial 9
dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
{
const char *p;
/* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ /* On native Win32, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+#else
if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-# locale-tr.m4 serial 6
+# locale-tr.m4 serial 7
dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
implement the Turkish upper-/lowercase mappings. Therefore, let this
program return 1 on BeOS. */
/* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ /* On native Win32, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+#else
if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On MacOS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-# locale-zh.m4 serial 7
+# locale-zh.m4 serial 8
dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
{
const char *p;
/* Check whether the given locale name is recognized by the system. */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+ /* On native Win32, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+#else
if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.