]> Savannah Git Hosting - gnulib.git/commit
c-nstrftime: New module.
authorBruno Haible <bruno@clisp.org>
Thu, 8 Feb 2024 00:09:08 +0000 (01:09 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 8 Feb 2024 00:11:48 +0000 (01:11 +0100)
commit2e665106444eb32b81e8e94df4b5d8e67723837f
tree7ddd4ae7095734c4c5b4aa70ddc2dec75bec6c36
parentde57613d999165a97ce54c93cb53069084cce08d
c-nstrftime: New module.

Suggested by Paul Eggert.

* lib/strftime.h (c_nstrftime): New declaration.
* lib/c-nstrftime.c: New file.
* lib/strftime.c (FPRINTFTIME): Move fallback definition before its
first use.
(USE_C_LOCALE): Add fallback definition.
If USE_C_LOCALE is set, include c-ctype.h instead of <ctype.h>.
Conditionally include <locale.h>.
(TOUPPER, TOLOWER): Define differently if USE_C_LOCALE is set.
(c_locale_cache, c_locale): New definitions, copied from lib/c-strtod.c.
(c_weekday_names, c_month_names): New variables, based on
glibc/time/strftime_l.c.
(__strftime_internal): Define a_wkday, aw_len, f_wkday, a_month, am_len,
f_month, ampm, ap_len differently for USE_C_LOCALE. Avoid a
'goto underlying_strftime' if USE_C_LOCALE && !HAVE_STRFTIME_L. Make the
strftime fallback declaration ISO C 23 compliant. If USE_C_LOCALE, use
strftime_l() with the C locale object instead of strftime().
* m4/c-nstrftime.m4: New file, based on m4/nstrftime.m4.
* modules/c-nstrftime: New file, based on modules/nstrftime.
ChangeLog
lib/c-nstrftime.c [new file with mode: 0644]
lib/strftime.c
lib/strftime.h
m4/c-nstrftime.m4 [new file with mode: 0644]
modules/c-nstrftime [new file with mode: 0644]