]> Savannah Git Hosting - gnulib.git/commitdiff
nstrftime: simplify by using libc-config.h.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 18 Dec 2021 19:39:17 +0000 (11:39 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 18 Dec 2021 19:39:57 +0000 (11:39 -0800)
* lib/nstrftime.c [!_LIBC]: Include libc-config.h
instead of config.h.
(iso_week_days): Simplify via libc-config.h’s __inline.
(my_strftime): Simplify via libc-config.h’s libc_hidden_def.
* modules/nstrftime (Depends-on): Add libc-config.

ChangeLog
lib/nstrftime.c
modules/nstrftime

index 0dcd3c0dcad9ff78e29f3b0022493995c98862b6..61f68406b4821d5996b74d237af1a2195d22b3bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2021-12-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       nstrftime: simplify by using libc-config.h.
+       * lib/nstrftime.c [!_LIBC]: Include libc-config.h
+       instead of config.h.
+       (iso_week_days): Simplify via libc-config.h’s __inline.
+       (my_strftime): Simplify via libc-config.h’s libc_hidden_def.
+       * modules/nstrftime (Depends-on): Add libc-config.
+
 2021-12-18  Bruno Haible  <bruno@clisp.org>
 
        libtextstyle-optional: Fix generation of textstyle.h (regr. 2021-12-15).
index 7f258e8727f758ef7652e924e938f7eb596cc9a9..25baf76c60f53c82b72fbb03c4bfd44ca6e602db 100644 (file)
@@ -22,7 +22,7 @@
 # define HAVE_TZNAME 1
 # include "../locale/localeinfo.h"
 #else
-# include <config.h>
+# include <libc-config.h>
 # if FPRINTFTIME
 #  include "fprintftime.h"
 # else
@@ -367,10 +367,7 @@ tm_diff (const struct tm *a, const struct tm *b)
 #define ISO_WEEK1_WDAY 4 /* Thursday */
 #define YDAY_MINIMUM (-366)
 static int iso_week_days (int, int);
-#if defined __GNUC__ || defined __clang__
-__inline__
-#endif
-static int
+static __inline int
 iso_week_days (int yday, int wday)
 {
   /* Add enough to the first operand of % to make it nonnegative.  */
@@ -428,9 +425,7 @@ my_strftime (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
   return __strftime_internal (s, STRFTIME_ARG (maxsize) format, tp, false,
                               0, -1, &tzset_called extra_args LOCALE_ARG);
 }
-#if defined _LIBC && ! FPRINTFTIME
 libc_hidden_def (my_strftime)
-#endif
 
 /* Just like my_strftime, above, but with more parameters.
    UPCASE indicates that the result should be converted to upper case.
index 64e255cdecdbc39ba7b1078ba7df9a95e6ea4fb5..a24af8dcb3275171bf85acdd6e6f33c6b87b13ac 100644 (file)
@@ -13,6 +13,7 @@ c99
 errno
 extensions
 intprops
+libc-config
 stdbool
 time_rz