From: Bruno Haible Date: Sun, 23 Feb 2020 11:25:42 +0000 (+0100) Subject: nstrftime: Use 'restrict'. X-Git-Tag: v1.0~4220 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=bf19526c73eb07080946178390834c2ab8ddfb83;p=gnulib.git nstrftime: Use 'restrict'. * lib/strftime.h (nstrftime): Use 'restrict'. * m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Require AC_C_RESTRICT. --- diff --git a/ChangeLog b/ChangeLog index cf441aefcd..31cd2274c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + nstrftime: Use 'restrict'. + * lib/strftime.h (nstrftime): Use 'restrict'. + * m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Require AC_C_RESTRICT. + mbstok_r: Use 'restrict'. * lib/string.in.h (mbstok_r): Use 'restrict'. diff --git a/lib/strftime.h b/lib/strftime.h index 97a062c631..e850163157 100644 --- a/lib/strftime.h +++ b/lib/strftime.h @@ -25,7 +25,7 @@ extern "C" { POSIX requires that strftime use the local timezone information. Use the timezone __TZ instead. Use __NS as the number of nanoseconds in the %N directive. */ -size_t nstrftime (char *, size_t, char const *, struct tm const *, +size_t nstrftime (char *restrict, size_t, char const *, struct tm const *, timezone_t __tz, int __ns); #ifdef __cplusplus diff --git a/m4/nstrftime.m4 b/m4/nstrftime.m4 index c15fab3e98..6f2762aa27 100644 --- a/m4/nstrftime.m4 +++ b/m4/nstrftime.m4 @@ -1,4 +1,4 @@ -# serial 34 +# serial 35 # Copyright (C) 1996-1997, 1999-2007, 2009-2020 Free Software Foundation, Inc. # @@ -10,6 +10,8 @@ AC_DEFUN([gl_FUNC_GNU_STRFTIME], [ + AC_REQUIRE([AC_C_RESTRICT]) + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. AC_REQUIRE([AC_STRUCT_TIMEZONE])