locale: Provide a complete 'struct lconv'.
authorBruno Haible <bruno@clisp.org>
Sun, 25 Mar 2012 11:56:33 +0000 (13:56 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 25 Mar 2012 11:56:33 +0000 (13:56 +0200)
* m4/locale_h.m4 (gl_LOCALE_H): Set REPLACE_STRUCT_LCONV to 1 if
'struct lconv' does not contain int_p_cs_precedes.
* tests/test-locale.c (main): Check that 'struct lconv' is complete.
* doc/posix-headers/locale.texi: Update.

ChangeLog
doc/posix-headers/locale.texi
m4/locale_h.m4
tests/test-locale.c

index 28b21d6..15dde81 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-03-25  Bruno Haible  <bruno@clisp.org>
 
+       locale: Provide a complete 'struct lconv'.
+       * m4/locale_h.m4 (gl_LOCALE_H): Set REPLACE_STRUCT_LCONV to 1 if
+       'struct lconv' does not contain int_p_cs_precedes.
+       * tests/test-locale.c (main): Check that 'struct lconv' is complete.
+       * doc/posix-headers/locale.texi: Update.
+
        locale: Provide a complete 'struct lconv' on Solaris 10, 11.
        * m4/locale_h.m4 (gl_LOCALE_H): On Solaris, define _LCONV_C99.
        * doc/posix-headers/locale.texi: Update.
index d8e8c82..cf9d474 100644 (file)
@@ -24,7 +24,7 @@ The @code{struct lconv} type does not contain the members
 @code{int_p_cs_precedes}, @code{int_p_sign_posn}, @code{int_p_sep_by_space},
 @code{int_n_cs_precedes}, @code{int_n_sign_posn}, @code{int_n_sep_by_space}
 on some platforms:
-glibc, Solaris 11 2011-11.
+glibc, OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11 2011-11, Cygwin 1.5.x, mingw, MSVC 9.
 
 @item
 Some platforms provide a @code{NULL} macro that cannot be used in arbitrary
@@ -34,10 +34,4 @@ NetBSD 5.0
 
 Portability problems not fixed by Gnulib:
 @itemize
-@item
-The @code{struct lconv} type does not contain the members
-@code{int_p_cs_precedes}, @code{int_p_sign_posn}, @code{int_p_sep_by_space},
-@code{int_n_cs_precedes}, @code{int_n_sign_posn}, @code{int_n_sep_by_space}
-on some platforms:
-OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x, mingw, MSVC 9.
 @end itemize
index 3de8e4d..266a2b1 100644 (file)
@@ -1,4 +1,4 @@
-# locale_h.m4 serial 16
+# locale_h.m4 serial 17
 dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -65,15 +65,18 @@ AC_DEFUN([gl_LOCALE_H],
   fi
   AC_SUBST([HAVE_XLOCALE_H])
 
-  dnl Check whether 'struct lconv' is well-defined.
+  dnl Check whether 'struct lconv' is complete.
   dnl Bionic libc's 'struct lconv' is just a dummy.
+  dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x,
+  dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members.
   AC_CACHE_CHECK([whether struct lconv is properly defined],
     [gl_cv_sys_struct_lconv_ok],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
           [[#include <locale.h>
             struct lconv l;
-            int x = sizeof (l.decimal_point);]],
+            int x = sizeof (l.decimal_point);
+            int y = sizeof (l.int_p_cs_precedes);]],
           [[]])],
        [gl_cv_sys_struct_lconv_ok=yes],
        [gl_cv_sys_struct_lconv_ok=no])
index 1dafdf3..e884ea1 100644 (file)
@@ -68,14 +68,12 @@ main ()
   ls += sizeof (l.n_sep_by_space);
   ls += sizeof (*l.int_curr_symbol);
   ls += sizeof (l.int_frac_digits);
-#if 0
   ls += sizeof (l.int_p_cs_precedes);
   ls += sizeof (l.int_p_sign_posn);
   ls += sizeof (l.int_p_sep_by_space);
   ls += sizeof (l.int_n_cs_precedes);
   ls += sizeof (l.int_n_sign_posn);
   ls += sizeof (l.int_n_sep_by_space);
-#endif
 
   return 0;
 }