Jim Meyering wrote: > Bottom line: now that we have mbrlen and mbsinit modules, > there's no point in testing HAVE_MBRLEN. > > diff --git a/lib/strftime.c b/lib/strftime.c > index 897aab7..3ade8cf 100644 > --- a/lib/strftime.c > +++ b/lib/strftime.c > @@ -50,14 +50,7 @@ extern char *tzname[]; > #define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE) > > #if DO_MULTIBYTE > -# if HAVE_MBRLEN > -# include <wchar.h> > -# else > - /* Simulate mbrlen with mblen as best we can. */ > -# define mbstate_t int > -# define mbrlen(s, n, ps) mblen (s, n) > -# define mbsinit(ps) (*(ps) == 0) > -# endif > +# include <wchar.h> > static const mbstate_t mbstate_zero; > #endif > > diff --git a/modules/strftime b/modules/strftime > index cc45452..dc53916 100644 > --- a/modules/strftime > +++ b/modules/strftime > @@ -10,6 +10,8 @@ m4/strftime.m4 > > Depends-on: > extensions > +mbrlen > +mbsinit > stdbool > time_r > wchar
Additionally, the test for mbrlen could be removed from m4/strftime.m4. Also, the test for mblen is obsolete: one can assume that all platforms have mblen() (see doc/posix-functions/mblen.texi). Also, it is safe to define MULTIBYTE_IS_FORMAT_SAFE to 1 for all platforms: In all locale encodings in use today, the byte '%' cannot occur inside a multibyte character except when representing the ASCII character '%'. (See also lib/mbschr.c line 34.) Also, the test for mempcpy is redundant since nothing uses it. Proposed patch: 2009-01-01 Bruno Haible <br...@clisp.org> * lib/strftime.c (MEMPCPY): Remove unused macro. * m4/strftime.m4 (gl_FUNC_STRFTIME): Don't test for mempcpy. --- lib/strftime.c.orig 2009-01-02 03:23:07.000000000 +0100 +++ lib/strftime.c 2009-01-02 03:22:45.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 Free Software +/* Copyright (C) 1991-1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. @@ -86,13 +86,6 @@ # define MEMCPY(d, s, n) memcpy (d, s, n) # define STRLEN(s) strlen (s) -# ifdef _LIBC -# define MEMPCPY(d, s, n) __mempcpy (d, s, n) -# else -# ifndef HAVE_MEMPCPY -# define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n))) -# endif -# endif #endif /* Shift A right by B bits portably, by dividing A by 2**B and --- m4/strftime.m4.orig 2009-01-02 03:23:07.000000000 +0100 +++ m4/strftime.m4 2009-01-02 03:22:52.000000000 +0100 @@ -1,7 +1,7 @@ -#serial 29 +#serial 30 # Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -# 2006, 2007 Free Software Foundation, Inc. +# 2006, 2007, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -25,7 +25,7 @@ AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_REQUIRE([gl_TM_GMTOFF]) - AC_CHECK_FUNCS_ONCE(mblen mbrlen mempcpy tzset) + AC_CHECK_FUNCS_ONCE(mblen mbrlen tzset) AC_CHECK_HEADERS_ONCE(wchar.h) AC_DEFINE([my_strftime], [nstrftime],