Check that <locale.h> defines locale_t and LC_GLOBAL_LOCALE.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Nov 2009 22:32:54 +0000 (23:32 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 23 Nov 2009 00:05:11 +0000 (01:05 +0100)
ChangeLog
modules/locale-tests
tests/test-locale.c

index 3e7980f5c3c042a7d23c5094337e83d0c136013b..394c56c80d5c29a7871267f95b9488c9fcc73163 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-11-22  Bruno Haible  <bruno@clisp.org>
 
+       * modules/locale-tests (configure.ac): Test for newlocale function.
+       * tests/test-locale.c: When the system has extended locale functions,
+       verify that <locale.h> defines locale_t and LC_GLOBAL_LOCALE.
+
        locale: Make locale_t available when possible.
        * lib/locale.in.h: Include <xlocale.h> when it exists.
        * m4/locale_h.m4 (gl_LOCALE_H): Check for <xlocale.h> and arrange to
index 19bc373cb9c62b29558895b904ba0bb51c9cde0b..1e6a0e8a89e02af1d24b17a89390722d61175dfc 100644 (file)
@@ -5,6 +5,7 @@ Depends-on:
 verify
 
 configure.ac:
+AC_CHECK_FUNCS_ONCE([newlocale])
 
 Makefile.am:
 TESTS += test-locale
index 625cc43d8446c3c6c1bd4bf0e4c57a4371417446..5bd7371f611212d98a77f9e2b30425e15cd1288f 100644 (file)
@@ -33,6 +33,11 @@ int a[] =
     LC_TIME
   };
 
+#if HAVE_NEWLOCALE
+/* Check that the locale_t type and the LC_GLOBAL_LOCALE macro are defined.  */
+locale_t b = LC_GLOBAL_LOCALE;
+#endif
+
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
 verify (sizeof NULL == sizeof (void *));