* doc/posix-functions/strftime.texi: Mention the %r problem.
* lib/nstrftime.c (__strftime_internal): On macOS, FreeBSD, and native
Windows, for %r, use the English AM/PM format.
+2024-05-27 Bruno Haible <bruno@clisp.org>
+
+ nstrftime: Make %r work on macOS, FreeBSD, native Windows.
+ * doc/posix-functions/strftime.texi: Mention the %r problem.
+ * lib/nstrftime.c (__strftime_internal): On macOS, FreeBSD, and native
+ Windows, for %r, use the English AM/PM format.
+
2024-05-27 Bruno Haible <bruno@clisp.org>
nstrftime: Make %h work on native Windows.
The %h specifier produces empty output on some platforms:
mingw, MSVC.
@item
+The %r specifier produces empty output on some platforms:
+mingw, MSVC.
+@item
The Windows C runtime library (which is used by MinGW) does not
support the %e specifier (and possibly the other more recent SUS
specifiers too, i.e., %C, %D, %h, %n, %r, %R, %t, and %T).
== L_('\0'))
subfmt = L_("%I:%M:%S %p");
goto subformat;
+#elif (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || (defined _WIN32 && !defined __CYGWIN__)
+ /* macOS, FreeBSD, native Windows strftime() may produce empty output
+ for "%r". */
+ subfmt = L_("%I:%M:%S %p");
+ goto subformat;
#else
goto underlying_strftime;
#endif