7821 Commits

Author SHA1 Message Date
Mathew Benson
cdb8dc76d9
Add C++-Modules Based Linux CI workflow (#4708)
- This adds a set of CI tests for linux that include compilers that
  support modules
- This CI workflow uses ninja as the build system generator
- Can be integrated with the other linux workflow after successful
  testing

Co-authored-by: Mathew Benson <mathew@benson.co.ke>
2026-03-28 09:45:56 -07:00
Victor Zverovich
602df7dab8 Simplify copy 2026-03-28 09:33:45 -07:00
user202729
7b2c4d064b
Speed up iterator_buffer (#4679) 2026-03-25 07:38:47 -07:00
Victor Zverovich
dc05bee307 Don't assume nul termination in printf
Thanks ZUENS2020 for reporting.
2026-03-23 13:28:26 -07:00
sunmy2019
ea85b81ccd
Support fmt::runtime with wchar_t in fmt::format_to_n (#4715) 2026-03-21 17:10:17 -07:00
Victor Zverovich
4968433a6a Minor cleanup 2026-03-16 14:34:20 -07:00
Victor Chernyakin
e8244777ee
Move a few classes into an anonymous namespace (#4713) 2026-03-15 07:33:33 -07:00
Victor Zverovich
879463ecad Apply cmake-format 2026-03-14 14:24:09 -07:00
Victor Zverovich
7733f4c136 Add cmake-format job 2026-03-14 13:51:29 -07:00
Victor Chernyakin
ae6fd83e2e
Make fmt/fmt-c.h compile with Clang on Windows (#4712) 2026-03-13 17:51:48 -07:00
Aaron Gokaslan
c0cd0fcfec
Add missing moves to grouping std::string member (#4704) 2026-03-11 09:52:40 -07:00
Victor Chernyakin
245e4d9723
Clean up a couple of CMake includes (#4710)
CMakeParseArguments is a no-op since CMake 3.5 and the
minimum version {fmt} supports is 3.8:
    https://cmake.org/cmake/help/latest/module/CMakeParseArguments.html

GNUInstallDirs is already unconditionally included
earlier in the file.
2026-03-11 06:32:04 -07:00
Mathew Benson
2b4eb7df47
Update Check for module support to include compiler versions (#4709)
- We need to confirm compiler support for module scanning before
  creating the CXX_MODULE FILE_SET using the `target_sources` command
- This is especially relevant for compilers that have module support but
  do not support the module scanning such as g++13, clang15. For these
    we can use the older way of creating the fmt-module target

Co-authored-by: Mathew Benson <mathew@benson.co.ke>
2026-03-09 15:37:46 -07:00
Victor Zverovich
c29b64dde7 Cleanup the C API 2026-03-08 14:33:23 -07:00
Ferdinand Bachmann
eb03303099
Replace the dummy arg from compound initializers in the C API with more macro magic (#4696)
The dummy argument {fmt_int} was there as a workaround for MSVC and to
avoid needing to rely on another GCC extension for zero-size arrays. Use
macro magic similar to FMT_NARG() instead that replaces the problematic
zero-size array with NULL.

In order to avoid a quadratic number of expansions, defer creating the
mapped argument list until after selection of whether to use NULL or
the fmt_arg array.

Signed-off-by: Ferdinand Bachmann <ferdinand.bachmann@yrlf.at>
2026-03-07 07:55:51 -08:00
Victor Zverovich
ab4f661521 Rename cmake-format config 2026-03-05 17:36:49 -08:00
Victor Zverovich
c8a6fd9177 Minor cleanup 2026-03-05 16:52:21 -08:00
Victor Zverovich
d38881410a Deprecated initializer_list join 2026-03-05 16:42:07 -08:00
Victor Zverovich
282b68cbd7
Update a link 2026-03-04 09:09:09 -08:00
Yancey
8277ee6aa0
Update fmt::join to support more character types (#4686) 2026-03-04 08:14:08 -08:00
Ferdinand Bachmann
e2bf61cdf8
Fix fmt-c.h not being installed with fmt-c library (#4694)
Signed-off-by: Ferdinand Bachmann <ferdinand.bachmann@yrlf.at>
2026-03-03 16:43:53 -08:00
Victor Zverovich
e090e3ffad Apply cmake-format 2026-03-03 15:49:40 -08:00
Victor Zverovich
eef9ff4938 Fix module test 2026-03-03 12:53:45 -08:00
Victor Zverovich
04434416a4 Remove unnecessary CI change 2026-03-03 12:35:39 -08:00
Victor Zverovich
011b24123b Cleanup module test 2026-03-03 12:30:54 -08:00
Victor Zverovich
43d4810ba9 Cleanup CMake config more 2026-03-03 11:40:10 -08:00
Victor Zverovich
e3a149f23c Cleanup CMake config 2026-03-03 09:51:56 -08:00
Victor Zverovich
af9bb5c075 Mark detail::named_arg as deprecated 2026-03-03 08:22:10 -08:00
Victor Zverovich
0f133953fb Tweak docs 2026-03-03 08:20:51 -08:00
Mathew Benson
4e1b170b44
Add Separate CMake Target for C++20 Modules (#4685)
* Add Separate CMake Target for C++20 Modules

In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.

The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake

The `add_module_library` function is marked as deprecated as its
functionality is superseded.

Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this

* Add Separate CMake Target for C++20 Modules

In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.

The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake

Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this

Fixed the test/CMakeLists.txt file which used the FMT_MODULE flag to
separate the module and non-module library testing, in particular
disableing the module version.

The module testing still needs to be fixed, but the expected behavior of
testing the non-modular version is working.

---------

Co-authored-by: Mathew Benson <mathew@benson.co.ke>
Co-authored-by: ClausKlein <claus.klein@arcormail.de>
2026-03-02 09:11:31 -08:00
dependabot[bot]
fca0445565
Bump actions/upload-artifact from 6.0.0 to 7.0.0 (#4691)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b7c566a772...bbbca2ddaa)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 13:06:20 -08:00
TPPPP
db4bea83d6
Move named_arg to public API (#4687) 2026-02-28 15:34:39 -08:00
Victor Zverovich
88c5a91487
Fix CI (#4690) 2026-02-28 08:37:13 -08:00
Bernd Petrovitsch
82553a7a5b
wrap macro arguments in parentheses for robustness (#4681)
Co-authored-by: Bernd Petrovitsch <bernd@sysprog.at>
2026-02-24 10:20:12 -08:00
Aaron Gokaslan
8d3f731763
Mark static arrays as constexpr for binary opt (#4680) 2026-02-23 17:08:35 -08:00
Victor Zverovich
dc97113ca1 Cleanup the C API 2026-02-21 17:15:19 -08:00
Victor Zverovich
60d5d0cec6 Workaround broken _Generic in MSVC 2026-02-21 15:04:38 -08:00
Victor Zverovich
9e5bb7ef77 Cleanup the C API 2026-02-21 11:46:23 -08:00
Soumik15630m
1dc644e021
Add C11 API with type-safe formatting (#4663) (#4671) 2026-02-16 07:06:32 -08:00
Stéén
b35de87ad9
std.h: Allow formatting std::unexpected type. (#4675)
In some cases, people might want to format the std::unexpected type itself,
independent of the value type, this commit makes it possible.

Co-authored-by: Robin Oger <robin.oger.work@gmail.com>
2026-02-11 15:06:59 -08:00
torsten48
f99d530247
Add include_guard (GLOBAL) to allow usage in multiple submodules (#4672) 2026-02-08 10:36:43 -08:00
Ruriwo
2d7dc922c6
Suppress warning C4305 (#4668) 2026-02-06 09:37:08 -08:00
ssszcmawo
28b082cc2b
Cleanup documentation (#4667)
* Cleanup documentation

* Fix comment typo in fmt::formatter struct

* Fix formatting and grammar in api.md

Corrected formatting and grammar in the API documentation.
2026-02-04 18:47:47 -08:00
Mike Vastola
2eda43e9be
Add FMT_USE_FLOCKFILE macro to force has_flockfile trait to false (#4666)
Fixes fmtlib/fmt#4646
2026-02-03 12:45:07 -08:00
Victor Zverovich
eb99f6eba6 Move std::byte formatter to std.h 2026-02-03 10:16:20 -08:00
Victor Zverovich
b98926b73b uint128_fallback -> uint128 2026-02-02 19:13:14 -08:00
Victor Zverovich
6322cf0520 int128_opt -> native_int128 2026-02-02 18:17:30 -08:00
Victor Zverovich
8dfd23651c Cleanup 2026-02-02 17:30:46 -08:00
Victor Zverovich
3f98b54bd7 Move _BitInt next to bitref formatter 2026-02-02 17:08:10 -08:00
Victor Zverovich
27b7be63bf Remove unnecessary pragmas 2026-02-02 11:40:58 -08:00