Commit Graph

6402 Commits

Author SHA1 Message Date
Félix-Antoine Constantin
99b9fbf8ef
Add formatter for std::source_location (#3730) 2023-11-30 10:05:56 -08:00
Victor Zverovich
8f83ee2ad1 Apply coding conventions 2023-11-30 08:24:02 -08:00
Victor Zverovich
2a8a694466 Clarify that mixing code unit types is deprecated 2023-11-30 08:20:01 -08:00
Victor Zverovich
04718008ab Minor cleanup 2023-11-30 07:43:31 -08:00
js324
b87ea22e29
Add native and generic representation for filesystem::path format spec (#3729) 2023-11-29 14:49:36 -08:00
Victor Zverovich
5cfd28d476 Experiment with FILE in scan 2023-11-26 10:01:42 -08:00
Victor Zverovich
73fae91e64 Cleanup .gitignore 2023-11-25 09:45:38 -08:00
Victor Zverovich
6988be3878 Bump version 2023-11-25 09:11:53 -08:00
Victor Zverovich
2d1e4bb35e Remove a useless comment 2023-11-25 09:05:20 -08:00
Corentin Schreiber
7f8d419115
Fix overflow in time_point formatting with large dates (#3727)
* Fix #3725 and rename fmt_safe_duration_cast to fmt_duration_cast
The function is now more generic and will handle all casts. It also
takes care of toggling safe vs unsafe casts using
FMT_SAFE_DURATION_CAST.

* Refactor fmt_duration_cast to put #ifdef inside the function

* Fix compilation error with FMT_USE_LOCAL_TIME
2023-11-25 08:36:55 -08:00
Victor Zverovich
ccc9ab7bf9 Include correct header 2023-11-25 08:23:41 -08:00
Victor Zverovich
c4283ec471 Fix a libc++ warning and move the test to the right place 2023-11-25 08:20:53 -08:00
Victor Zverovich
c3f9a73445 Apply coding conventions 2023-11-25 07:43:44 -08:00
Victor Zverovich
06f1c0d725 Clarify that calling non-const format is deprecated 2023-11-24 10:21:57 -08:00
Victor Zverovich
ffa5b14fe3 Make gtest-extra-test more portable 2023-11-24 10:09:21 -08:00
Victor Zverovich
bea7ecc710 Disable locale-specific tests on OpenBSD 2023-11-24 09:45:56 -08:00
Victor Zverovich
8a39388516 Fix the default locale in ostream_formatter 2023-11-24 09:24:43 -08:00
Peter Johnson
dd6f657a79
Remove this-> from decltype (#3723)
* Remove this-> from decltype

The latest version of MSVC doesn't like it, and removing it doesn't seem to harm anything.

* Add ifdef for GCC < 5
2023-11-22 09:46:04 -08:00
Victor Zverovich
c13753a70c Fix handling of invalid Unicode in precision 2023-11-18 08:36:11 -10:00
Ole Bøe
864a8b5f38
fix: support optional<T> with format_as(T) (#3713)
Formatting a std::optional<T> where T had a custom format_as(T) function failed to compile with clang,
due to set_debug_format being hidden by private inheritance. This fix makes the function available through a using clause.
2023-11-16 15:02:33 -08:00
Victor Zverovich
649fe0fc8b Fix handling of null strings with the s specifier 2023-11-15 17:03:01 -10:00
Kai Aoki
45e124ee43
Added workaround for old xcode compiler bug (#3716)
* Added macros to disable std::filesystem and std::variant as a workaround for old xcode bugs

* Change macro to positive logic
2023-11-15 09:19:08 -08:00
Victor Zverovich
045b05d79e Revert CMake changes 2023-11-14 06:48:16 -10:00
Victor Zverovich
ec628561c2 Fix formatting 2023-11-13 06:41:28 -10:00
Luis Caro Campos
cbb18c237a
Add support for CMake 3.28 C++ modules (#3679) 2023-11-13 08:34:42 -08:00
Victor Zverovich
6b0082e6c7 Improve OpenBSD workaround 2023-11-07 09:24:33 -10:00
Petr Klima
52a99a67f7
Set PDB path for Visual Studio (#3702)
Ensure the PDB files are output into the same directory and with the same name
as the static library when using Visual Studio.

Resolves fmtlib#3701.
2023-11-07 08:22:52 -08:00
Victor Zverovich
4548d1eae2 Make write_escaped_path more portable 2023-11-07 05:46:15 -10:00
Victor Zverovich
050d41e857 Make get_path_string more portable 2023-11-06 14:34:53 -10:00
Victor Zverovich
1c023c0087 Update bootstrap 2023-11-06 08:20:01 -10:00
hotwatermorning
b35d4e40fe fix: use FMT_HAS_INCLUDE instead of __has_include 2023-11-03 15:10:40 -07:00
hotwatermorning
acaf83f40f feat: enable building with gcc 4.8 2023-11-03 02:38:05 +09:00
hotwatermorning
05aa783779 feat: include xlocale.h only if exists 2023-11-03 02:38:05 +09:00
dependabot[bot]
05dda9490d
Bump ossf/scorecard-action from 2.2.0 to 2.3.1 (#3697)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.2.0 to 2.3.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](08b4669551...0864cf1902)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 12:38:06 -07:00
dependabot[bot]
caf4fcb207
Bump github/codeql-action from 2.21.5 to 2.22.5 (#3696)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.5 to 2.22.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](00e563ead9...74483a38d3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 12:37:23 -07:00
Carl Smedstad
e0d3e346d2
Wrap Char in array to avoid pointer arithmetic (#3695)
This resolves the following finding reported by Coverity Static Analysis
v2023.6.1 on line 1964 of fmt/include/fmt/format.h:

  ptr_arith: Using &v as an array. This might corrupt or misinterpret
             adjacent memory locations.
2023-10-31 14:05:46 -07:00
Victor Zverovich
19276d7325 Fix an inconsistentcy between to_string and format 2023-10-28 08:05:11 -07:00
Dimitrij Mijoski
2a2c6e676f
Fix flushing C++ iostreams before calling write_console() (#3689)
This change correctly implements https://wg21.link/P2539/ for both
C streams and C++ iostreams.

Fixes #3688.
2023-10-25 13:13:31 -07:00
Roman Koshelev
3b7f58a8b3 add buffer flush before direct write 2023-10-24 16:02:37 -07:00
Victor Zverovich
e9bbd4069e
Update README.rst 2023-10-22 09:13:14 -07:00
Victor Zverovich
857cce7a83
Update README.rst 2023-10-22 08:45:50 -07:00
Victor Zverovich
081d5b0d8b
Update README.rst 2023-10-22 08:30:04 -07:00
Carson Riker
baae1ed658
add meson instructions to usage docs (#3677) 2023-10-18 11:53:47 -07:00
June Liu
2ac6c5ca8b
Fix error C2668 on Windows with option /std:c++latest (#3680)
* Namespace-qualify to avoid ambiguity with std::format_to for format-test.cc

When build fmt with MSVC under option /std:c++latest, it failed due to `error 2668: 'std::format_to': ambiguous call to overloaded function`, so add namespace to qualify the call to format_to to avoid this issue.
2023-10-16 09:54:02 -07:00
Victor Zverovich
d9063baf22 Fix perf regression in ostream::print 2023-10-15 08:23:36 -07:00
Victor Zverovich
f7542c5761 Apply clang-format 2023-10-14 06:52:43 -07:00
Victor Zverovich
130cf54cbc Use a more sensible locale in tests 2023-10-08 10:49:21 -07:00
Victor Zverovich
8e0ca0589f Use a more sensible locale in tests 2023-10-08 09:21:02 -07:00
Victor Zverovich
bf497ac068 Cleanup test 2023-10-08 07:30:08 -07:00
Richard Kellnberger
bb8d50f04b
add a suffix for days and fix the one for minutes (#3664) 2023-10-07 12:45:34 -07:00