c_formatter assumed a fixed 24 character field, but the day of month is printed without padding, so dates on days 1-9 are 23 characters wide. E_formatter assumed a fixed 10 character field for a variable length number. scoped_padder sizes padding and truncation from that value, so padded output was too short and the ! truncation cut characters from the field (and from preceding output for %E).
Compute the real width from the printed values instead.
Co-authored-by: Gabi Melman <gmelman1@gmail.com>
to12h() only subtracted 12 for hours above 12, so hour 0 stayed 0 and
%I printed "00" and %r "00:30:00 AM" during the first hour of the day.
The documented range of %I is 01-12, and strftime prints 12 there.
Co-authored-by: Michiel van Slobbe <michiel.van.slobbe@gmail.com>
Co-authored-by: Gabi Melman <gmelman1@gmail.com>
* Add test case for #3351 (wrong GMT offset in SunOS/Solaris fallback)
* Fix#3352 (Missing test for Apple / POSIX.1-2024 chooses buggy workaround)
Apple platforms have had the tm_gmtoff-field at least since Mac OS X 10.0,
as are POSIX.1-2024 conforming systems, which are also required to support
it.
This has the unfortunate effect to use the SunOS/Solaris fallback, which
doesn't compute the correct value if the passed value of tm isn't the
current system time, i.e. localtime(::time()) (#3351).
* Fixed GMT offset test
---------
Co-authored-by: toh <toh@ableton.com>
* Added Mapped Diagnostic Context (MDC) support
* Update include statement
* Optimize string creation
* Fix includes
* Fix padding rules in mdc empty case
* Add comment to describe the use of mdc formatter
* Support compile-time format string checking with std::format
* Fix pre-VS 17.5 compilation
* Fix compilation without wchar_t support
* What am I doing
* Bring back fmt optimization
* Move to_string_view to common.h
* Fix SPDLOG_CONSTEXPR_FUNC emitting duplicate symbol errors when building in C++11
* Also add inline on VS 2013
* Appender doesn't work on wide strings