Commit Graph

166 Commits

Author SHA1 Message Date
LoveSy
8687315e86
Guard more system headers by FMT_MODULE (#4006)
* Guard more system headers by `FMT_MODULE`

* Merge FMT_MODULE and FMT_IMPORT_STD
2024-06-14 10:53:51 -07:00
Victor Zverovich
1d9df9ce1c Remove a redundant comment 2024-06-13 15:41:35 -07:00
LoveSy
2bf811b1d9
Also allow compiled format for clang >= 12 (#4001) 2024-06-09 06:43:39 -07:00
LoveSy
0f6e716548
Fix missing includes in fmt.cc (#3994)
This causes duplicated std definitions in the fmt module
2024-06-08 13:50:29 -07:00
Victor Zverovich
ab29ef37d9 Migrate docs and cleanup 2024-06-02 13:17:04 -07:00
Victor Zverovich
38ba3d3993 Migrate to mkdocs 2024-06-02 08:26:56 -07:00
Victor Zverovich
03d14c3beb Add support for multiple namespaces 2024-06-02 07:01:40 -07:00
Victor Zverovich
febeb51bde Documentation improvements 2024-06-01 17:45:06 -07:00
Victor Zverovich
933d8ba352 Improve apidoc formatting 2024-06-01 09:24:32 -07:00
Victor Zverovich
91a859ee4a Switch to markdown 2024-06-01 08:56:26 -07:00
Victor Zverovich
a4d42c44f4 Cleanup comments 2024-06-01 07:00:56 -07:00
Victor Zverovich
cf9833f40b Cleanup apidoc comments 2024-05-29 20:30:19 -07:00
Matthias Moulin
1752d7fbbb
Added formattable concept (#3974) 2024-05-26 07:47:56 -07:00
Edoardo Lolletti
028bffa083
Update checks for dynamic_cast usage when compiled with no rtti (#3963)
* Rename FMT_USE_TYPEID to FMT_HAS_RTTI and use it as check to enable dynamic_cast usage

* FMT_HAS_RTTI->FMT_USE_RTTI
2024-05-19 11:21:55 -07:00
Victor Zverovich
1f436c646e Cleanup locking/buffering 2024-05-12 09:34:17 -07:00
Victor Zverovich
db1ee420e0 Cleanup unicode check more 2024-05-11 20:02:22 -07:00
Victor Zverovich
7d6ae972b9 Cleanup unicode checks 2024-05-11 19:43:46 -07:00
Victor Zverovich
3460b30fd5 Improve utf-8 detection 2024-05-11 18:58:40 -07:00
Victor Zverovich
b7809f91e2 Enable Unicode support by default 2024-05-11 15:11:23 -07:00
Victor Zverovich
1dc71f21ea Enable Unicode by default 2024-05-10 18:27:45 -07:00
Marlene Cota
48c908453d
Fix CodeQL alert (#3945) 2024-04-30 12:41:29 -07:00
Victor Zverovich
f746a59a5c Cleanup FMT_ASSERT 2024-04-19 08:36:16 -07:00
Justin Riddell
99735764ea
Fix FMT_USE_NONTYPE_TEMPLATE_ARGS define back (#3937)
Broken in refactor f1924d3
2024-04-16 13:29:30 -07:00
Matthias Moulin
116a9ce488
Added FMT_IMPORT_STD feature macro (#3928) 2024-04-10 11:48:32 -07:00
Matthias Moulin
550437b29e
Resolved warning C4127: conditional expression is constant (#3923) 2024-04-07 11:01:26 -07:00
Philippe Proulx
4e8640ed90
Fix: enable FMT_NORETURN without exception support too (#3917)
When building `format.cc` as such with GCC 13.2.1:

    $ g++ -c format.cc -DFMT_EXCEPTIONS=0 -Wmissing-noreturn -Werror

I get:

    In file included from format.cc:8:
    fmt/format-inl.h: In function ‘void fmt::v10::detail::assert_fail(const char*, int, const char*)’:
    fmt/format-inl.h:30:15: error: function might be candidate for attribute ‘noreturn’ [-Werror=suggest-attribute=noreturn]
       30 | FMT_FUNC void assert_fail(const char* file, int line, const char* message) {
          |               ^~~~~~~~~~~
    fmt/format-inl.h: In function ‘void fmt::v10::report_error(const char*)’:
    fmt/format-inl.h:129:15: error: function might be candidate for attribute ‘noreturn’ [-Werror=suggest-attribute=noreturn]
      129 | FMT_FUNC void report_error(const char* message) {
          |               ^~~~~~~~~~~~
    cc1plus: all warnings being treated as errors

Note that, with `FMT_EXCEPTIONS` defined to 0:

‣ report_error(const char *) uses FMT_THROW() which expands to calling
  assert_fail().

‣ assert_fail() calls std::terminate() which has the `[[noreturn]]`
  attribute since C++11 [1].

Therefore, with `FMT_EXCEPTIONS` defined to 0, both assert_fail() and
report_error() need to have the `[[noreturn]]` attribute too (if
available). In other words, `FMT_NORETURN` doesn't depend on
`FMT_EXCEPTIONS`.

Also adding `FMT_NORETURN` to two on_error() functions which call
report_error(const char *).

Other report_error() overloads eventually return, therefore they don't
need `FMT_NORETURN`.

[1]: https://en.cppreference.com/w/cpp/error/terminate

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
2024-04-04 17:15:18 -07:00
Victor Zverovich
5d63e87d23 Add a formatter for float128 2024-03-22 15:41:50 +09:00
Victor Zverovich
aecec01b34 Initial support for extended FP types 2024-03-22 15:08:25 +09:00
Victor Zverovich
e281749c5d Simplify range formatter 2024-03-10 08:19:26 -07:00
Victor Zverovich
3bc6cc1e63 Protect against locking formatters 2024-03-02 17:23:02 -08:00
Victor Zverovich
f68f452dea Workaround an ld warning on macOS 2024-02-25 11:41:52 -08:00
Anders Dalvander
ae181cc93d
C++23 compatibility: basic_string_view cannot be constructed from nullptr (#3846)
Co-authored-by: Anders Dalvander <anders.dalvander@sartorius.com>
2024-02-09 07:39:43 -08:00
Bruce Mitchener
3a6fb2fcaf
Fix some typos. (#3843) 2024-02-08 10:59:52 -08:00
Afanasyev Ivan
1b54ba4b9d
Fix UB in format_arg_store implementation. (#3833) 2024-01-31 10:08:29 -08:00
Victor Zverovich
a1e1eedbb5 Minor cleanup 2024-01-27 14:00:13 -08:00
Victor Zverovich
4c5b4af04d Improve name argument validation 2024-01-19 16:13:43 -08:00
Victor Zverovich
8510838db1 Make format_specs not depend on code unit type 2024-01-17 07:50:52 -08:00
The Phantom Derpstorm
13ec66bf78
🛠 Add basic array safety functions and backwards-compatible result type (#3805) 2024-01-16 07:01:15 -08:00
Victor Zverovich
64091b7a25 Fix naming 2024-01-15 15:17:46 -08:00
Victor Zverovich
e954823531 Make fill independent on code unit type 2024-01-15 15:00:28 -08:00
Victor Zverovich
83652dfee7 Restrict always inlining to the top-level API 2024-01-15 10:09:01 -08:00
Bruce Mitchener
73d91351b4
Mark iterator_buffer move constructors as noexcept. (#3808) 2024-01-15 08:46:35 -08:00
Victor Zverovich
fe0d910a7d Replace multiple error reporting mechanisms with report_error 2024-01-15 07:23:06 -08:00
Victor Zverovich
f9294f0e60 Improve handling of format specs 2024-01-15 06:31:24 -08:00
Victor Zverovich
d70729215f Fix constness 2024-01-14 06:44:38 -08:00
Victor Zverovich
56fa4d61f6 Fix docs 2024-01-13 19:03:23 -08:00
Victor Zverovich
cacdf1439f Remove nonstandard alias 2024-01-13 15:56:16 -08:00
Victor Zverovich
d0963d4823 Make ranges only depend on fmt/base.h 2024-01-13 09:54:19 -08:00
Victor Zverovich
da0f84c42c Cleanup copy functions and move to base.h 2024-01-13 09:31:20 -08:00
Victor Zverovich
0cdee904a4 Add a missing num_bits specialization 2024-01-12 07:20:12 -08:00
Victor Zverovich
7e58af4eaf Fix an ICE on clang <= 15 2024-01-12 06:48:03 -08:00
Victor Zverovich
f1924d3269 Cleanup macros 2024-01-12 06:35:25 -08:00
Victor Zverovich
52174953bc Cleanup conseval detection 2024-01-12 05:59:22 -08:00
Victor Zverovich
b71d98774b Reduce usage of FMT_COSTEXPR20 2024-01-11 21:27:00 -08:00
Victor Zverovich
810d1750f1 Cleanup constexpr detection 2024-01-11 21:08:01 -08:00
Victor Zverovich
170ffb1ff8 Simplify constexpr checks 2024-01-11 20:26:52 -08:00
Victor Zverovich
e470ba8b7b Simplify exception detection 2024-01-11 19:42:06 -08:00
Victor Zverovich
bf98e3e4c6 Cleanup macros 2024-01-11 19:16:35 -08:00
Victor Zverovich
fd87a23d34 Reduce memory dependency 2024-01-10 20:00:15 -08:00
Victor Zverovich
c5340539f9 Remove unnecessary trait specialization 2024-01-10 18:11:37 -08:00
Victor Zverovich
971f7ae768 Minor cleanup 2024-01-10 16:43:00 -08:00
Victor Zverovich
da7a232b9e Cleanup contexts 2024-01-10 13:09:55 -08:00
Victor Zverovich
4331abed26 Move fmt::format to fmt/format.h 2024-01-10 06:43:12 -08:00
Victor Zverovich
fc8f6ba934 Separate compilation for println 2024-01-10 05:55:26 -08:00
Victor Zverovich
58a6bd48a8 Add core.h for compatibility 2024-01-09 20:10:30 -08:00
Victor Zverovich
79f1506fe3 Add base.h 2024-01-09 19:36:12 -08:00