Commit Graph

7682 Commits

Author SHA1 Message Date
Victor Zverovich
69324379f2 Mark detail::assert_fail as deprecated 2025-08-31 08:11:57 -07:00
Björn Schäpers
ff1caa58c9 Use FMT_THROW in report_error (#4521)
With exceptions: No change (if FMT_THROW is not user provided)

Without exceptions: Now also states where it comes from (report_error)
and uses fprintf instead of fputs.

My motivation is, now that I have my own fmt::assert_failed, also to get
rid of fputs for my embedded build.
2025-08-31 08:05:54 -07:00
Björn Schäpers
e181e94140 Add FMT_CUSTOM_ASSERT_FAIL (#4505)
That way one can provide ones own implementation for assert_fail, which
is moved out of the detail namespace. For binary compatibility the
detail version stays to call the outer version.
2025-08-25 09:02:00 -07:00
Victor Zverovich
43c88d00ae Update changelog 2025-08-24 10:08:53 -07:00
Victor Zverovich
33a7d55c9b Update changelog 2025-08-24 10:04:00 -07:00
Victor Zverovich
8e4676e4a5 Remove deprecated template parameter 2025-08-24 09:52:17 -07:00
Victor Zverovich
b5c4d25cd1 Rename is_char to is_code_unit 2025-08-24 09:30:50 -07:00
Victor Zverovich
a77efa4b4a Move is_*char to detail 2025-08-24 09:16:18 -07:00
Victor Zverovich
e7e71009c7 Make FP formatting compatible with exotic chars 2025-08-24 08:49:54 -07:00
Victor Zverovich
b7b261977e Simplify report_error 2025-08-24 08:30:17 -07:00
Victor Zverovich
61e0503daf Merge workarounds for bogus MSVC warnings 2025-08-24 08:18:47 -07:00
Victor Zverovich
72c82296d6 Put FMT_END_* together 2025-08-17 12:25:40 -07:00
Victor Zverovich
a402614e8c Remove deprecated aliases 2025-08-17 11:52:00 -07:00
Victor Zverovich
e719c43cc6 Apply coding conventions 2025-08-17 10:59:16 -07:00
Victor Zverovich
8a8ff6177c Remove deprecated and undocumented has_formatter 2025-08-17 10:52:45 -07:00
Victor Zverovich
5b99b334f0 Remove redundant else 2025-08-17 10:03:01 -07:00
Mattias Ljungström
9588458917 Silence unreachable code warnings in MSVC when FMT_USE_EXCEPTIONS are disabled. (#4515) 2025-08-17 09:35:28 -07:00
Victor Zverovich
f91dc80f4c Minor cleanup 2025-08-16 14:49:26 -07:00
Victor Zverovich
4120581167 Minor cleanup 2025-08-16 14:20:06 -07:00
Victor Zverovich
7ffc3ca15b Minor cleanup 2025-08-16 12:20:02 -07:00
Victor Zverovich
e9ddc97b9a Remove unnecesary constexpr and inline more 2025-08-10 08:40:35 -07:00
Murat Toprak
0d145936ec Handle allocator propagation in basic_memory_buffer::move, Fix #4487 (#4490)
* Handle allocator propagation in basic_memory_buffer::move

Update `basic_memory_buffer::move` to respect `propagate_on_container_move_assignment`allocator trait.
If the allocator should not propagate and differs from the target's allocator,
fallback to copying the buffer instead of transferring ownership.

This avoids potential allocator mismatch issues and ensures exception safety.

* Add test cases for the updated move ctor

- Added two test cases `move_ctor_inline_buffer_non_propagating` and `move_ctor_dynamic_buffer_non_propagating`
- Added `PropageteOnMove` template parameter to `allocator_ref` class to be compatible with the old test cases
- `allocator_ref` now implements `!=` and `==` operators
2025-08-09 08:14:15 -07:00
Victor Chernyakin
8f3a965186 Refactor ansi_color_escape to track size instead of using a null terminator (#4511) 2025-08-09 08:08:41 -07:00
Victor Chernyakin
ae8cb1e8e6 Ignore some more files in .gitignore (#4512) 2025-08-05 13:41:50 -07:00
Victor Zverovich
add164f6b3 Optimize the default FP formatting 2025-08-03 12:46:38 -07:00
Victor Zverovich
23059d558e Fix exponent size computation 2025-08-03 10:00:24 -07:00
Victor Zverovich
505cc3d0c2 Simplify remove_trailing_zeros 2025-08-03 08:45:48 -07:00
Victor Zverovich
b8a502615d Revert "Optimize the default FP formatting"
This reverts commit 93f03953af.
2025-08-03 07:40:13 -07:00
dependabot[bot]
814f51eab6 Bump github/codeql-action from 3.28.16 to 3.29.5 (#4510)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.16 to 3.29.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](28deaeda66...51f77329af)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.5
  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>
2025-08-01 11:52:42 -07:00
Victor Zverovich
93f03953af Optimize the default FP formatting 2025-07-27 08:56:07 -07:00
Dominic Pöschko
35dcc58263 fix buffer overflow on all emphasis flags set (#4498) 2025-07-20 10:43:33 -07:00
Catherine
553ec11ec0 Make compatible with WASI (#4497)
WASI is a POSIX subset that doesn't have `dup`, `dup2`, or `pipe` system calls.

Fixes #4496.
2025-07-14 15:51:04 -07:00
autoantwort
a0ecfe3e1c msvc + ninja + modules: Fix build when consuming fmtlib while using a Ninja generator (#4495)
Co-authored-by: Leander Schulten <Leander.Schulten@tetys.de>
2025-07-13 10:28:00 -07:00
Victor Zverovich
127413ddaa Add OpenSSF Best Practices badge 2025-07-12 07:12:18 -07:00
Victor Zverovich
7d29ebe4af Minor cleanup 2025-07-12 07:09:38 -07:00
anonymous
20c8fdad06 Fix import std in clang++ (#4488)
fix module-compilation error when defined `FMT_IMPORT_STD`
2025-07-07 11:47:48 -07:00
Victor Zverovich
300ce75ca6 Handle invalid glibc FILE buffer 2025-07-06 11:17:16 -07:00
Victor Zverovich
513f978241 Cleanup os-test 2025-07-04 10:52:59 -07:00
Victor Zverovich
6a3b40524c Use actual example code and move safe_fopen to os-test 2025-07-04 09:50:55 -07:00
Victor Chernyakin
2fa3e1a1bb Fix interaction between debug presentation, precision, and width for strings (#4478) 2025-07-04 07:33:47 -07:00
dependabot[bot]
fc8d07cfe5 Bump msys2/setup-msys2 from 2.27.0 to 2.28.0 (#4485)
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.27.0 to 2.28.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](61f9e5e925...40677d36a5)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.28.0
  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>
2025-07-01 08:42:01 -07:00
Miuna
27c5aab349 Fix unwanted char promotion in decimal writer with wchar_t (#4483) 2025-07-01 07:03:57 -07:00
Victor Zverovich
bc0193535a Update image 2025-06-29 07:50:09 -07:00
Miuna
353bd895a2 Add FMT_EXPORT on ranges.h customization points (#4476) 2025-06-24 10:30:44 -07:00
Tomek-Stolarczyk
953cffa701 Replace memset with constexpr fill_n in bigint::align (#4471)
Use fill_n in place of memset in bigint::align to respect constexpr.
2025-06-23 16:18:16 -07:00
Vladislav Shchapov
571c02d475 Add xchar support for std::byte formatter (#4480)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2025-06-23 14:02:11 -07:00
Remy Jette
f4345467fc Fix compilation on clang-21 / libc++-21 (#4477)
`<cstdlib>` was not being included, so malloc and free were only declared
via transitive includes. Some includes changed in the latest libc++-21
build which broke fmt.

Also changed `malloc`/`free` to `std::malloc` and `std::free`, as
putting those symbols in the global namespace is optional for the
implementation when including `<cstdlib>`.
2025-06-21 07:28:14 -07:00
Victor Chernyakin
1ef8348070 Properly constrain detail::copy optimization (#4474) 2025-06-21 06:59:35 -07:00
Sahil Sinha
a5dccffa56 Add double and float support to scan test
- Add double_type and float_type to scan_type enum
- Add double* and float* pointers to scan_arg union
- Add constructors for double and float scan arguments
- Add switch cases for double and float types in visit()
- Implement basic read() functions for floating-point parsing

This partially resolves the TODO comment 'more types' in scan.h by adding
support for the two most commonly needed floating-point types.
2025-06-21 06:57:20 -07:00
Victor Zverovich
4a149f513f Test non-SSO constexpr string formatting 2025-06-20 07:10:12 -07:00