Skip to content

Commit a33c558

Browse files
authored
Merge branch 'fmtlib:master' into zig-pkg
2 parents f2fd9c7 + a08196b commit a33c558

File tree

3 files changed

+63
-26
lines changed

3 files changed

+63
-26
lines changed

ChangeLog.rst

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
10.0.0 - TBD
2-
------------
1+
10.0.0 - 2023-05-09
2+
-------------------
33

44
* Replaced Grisu with a new floating-point formatting algorithm for given
55
precision (`#3262 <https://github.com/fmtlib/fmt/issues/3262>`_,
66
`#2750 <https://github.com/fmtlib/fmt/issues/2750>`_,
7-
`#3269 <https://github.com/fmtlib/fmt/pull/3269>`_).
7+
`#3269 <https://github.com/fmtlib/fmt/pull/3269>`_,
8+
`#3276 <https://github.com/fmtlib/fmt/pull/3276>`_).
89
The new algorithm is based on Dragonbox already used for the
910
shortest representation and gives substantial performance improvement:
1011

@@ -20,6 +21,7 @@
2021
* Replaced ``snprintf``-based hex float formatter with an internal
2122
implementation (`#3179 <https://github.com/fmtlib/fmt/pull/3179>`_,
2223
`#3203 <https://github.com/fmtlib/fmt/pull/3203>`_).
24+
This removes the last usage of ``s(n)printf`` in {fmt}.
2325
Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
2426

2527
* Fixed alignment of floating-point numbers with localization
@@ -69,7 +71,8 @@
6971

7072
* Added support for fill, align and width to the time point formatter
7173
(`#3237 <https://github.com/fmtlib/fmt/issues/3237>`_,
72-
`#3260 <https://github.com/fmtlib/fmt/pull/3260>`_).
74+
`#3260 <https://github.com/fmtlib/fmt/pull/3260>`_,
75+
`#3275 <https://github.com/fmtlib/fmt/pull/3275>`_).
7376
For example (`godbolt <https://godbolt.org/z/rKP6MGz6c>`__):
7477

7578
.. code:: c++
@@ -105,7 +108,7 @@
105108
`@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
106109
`@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
107110

108-
* Add precision support to ``%S``
111+
* Added precision support to ``%S``
109112
(`#3148 <https://github.com/fmtlib/fmt/pull/3148>`_).
110113
Thanks `@SappyJoy (Stepan Ponomaryov) <https://github.com/SappyJoy>`_
111114

@@ -125,11 +128,33 @@
125128
`#3222 <https://github.com/fmtlib/fmt/pull/3222>`_).
126129
Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
127130

128-
* Improved validation of format specifiers for `std::chrono::duration`
131+
* Improved validation of format specifiers for ``std::chrono::duration``
129132
(`#3219 <https://github.com/fmtlib/fmt/issues/3219>`_,
130133
`#3232 <https://github.com/fmtlib/fmt/pull/3232>`_).
131134
Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
132135

136+
* Fixed formatting of time points before the epoch
137+
(`#3117 <https://github.com/fmtlib/fmt/issues/3117>`_,
138+
`#3261 <https://github.com/fmtlib/fmt/pull/3261>`_).
139+
For example (`godbolt <https://godbolt.org/z/f7bcznb3W>`__):
140+
141+
.. code:: c++
142+
143+
#include <fmt/chrono.h>
144+
145+
int main() {
146+
auto t = std::chrono::system_clock::from_time_t(0) -
147+
std::chrono::milliseconds(250);
148+
fmt::print("{:%S}\n", t); // prints 59.750000000
149+
}
150+
151+
Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
152+
153+
* Experimental: implemented glibc extension for padding seconds, minutes and
154+
hours (`#2959 <https://github.com/fmtlib/fmt/issues/2959>`_,
155+
`#3271 <https://github.com/fmtlib/fmt/pull/3271>`_).
156+
Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
157+
133158
* Added a formatter for ``std::exception``
134159
(`#2977 <https://github.com/fmtlib/fmt/issues/2977>`_,
135160
`#3012 <https://github.com/fmtlib/fmt/issues/3012>`_,
@@ -183,6 +208,9 @@
183208

184209
Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
185210

211+
* Added a formatter for ``std::optional`` to ``fmt/std.h``.
212+
Thanks `@tom-huntington <https://github.com/tom-huntington>`_.
213+
186214
* Fixed formatting of valueless by exception variants
187215
(`#3347 <https://github.com/fmtlib/fmt/pull/3347>`_).
188216
Thanks `@TheOmegaCarrot <https://github.com/TheOmegaCarrot>`_.
@@ -205,22 +233,9 @@
205233

206234
* Improved handling of invalid Unicode in paths.
207235

208-
* Fixed formatting of time points before the epoch
209-
(`#3117 <https://github.com/fmtlib/fmt/issues/3117>`_,
210-
`#3261 <https://github.com/fmtlib/fmt/pull/3261>`_).
211-
For example (`godbolt <https://godbolt.org/z/f7bcznb3W>`__):
212-
213-
.. code:: c++
214-
215-
#include <fmt/chrono.h>
216-
217-
int main() {
218-
auto t = std::chrono::system_clock::from_time_t(0) -
219-
std::chrono::milliseconds(250);
220-
fmt::print("{:%S}\n", t); // prints 59.750000000
221-
}
222-
223-
Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
236+
* Enabled compile-time checks on Apple clang 14 and later
237+
(`#3331 <https://github.com/fmtlib/fmt/pull/3331>`_).
238+
Thanks `@cloyce (Cloyce D. Spradling) <https://github.com/cloyce>`_.
224239

225240
* Improved compile-time checks of named arguments
226241
(`#3105 <https://github.com/fmtlib/fmt/issues/3105>`_,
@@ -274,6 +289,13 @@
274289
``basic_format_string`` (`#3111 <https://github.com/fmtlib/fmt/pull/3111>`_).
275290
Thanks `@huangqinjin <https://github.com/huangqinjin>`_.
276291

292+
* Added ``println`` for compatibility with C++23
293+
(`#3267 <https://github.com/fmtlib/fmt/pull/3267>`_).
294+
Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
295+
296+
* Renamed the ``FMT_EXPORT`` macro for shared library usage to
297+
``FMT_LIB_EXPORT``.
298+
277299
* Improved documentation
278300
(`#3108 <https://github.com/fmtlib/fmt/issues/3108>`_,
279301
`#3169 <https://github.com/fmtlib/fmt/issues/3169>`_,
@@ -292,10 +314,15 @@
292314
`#3207 <https://github.com/fmtlib/fmt/pull/3207>`_,
293315
`#3210 <https://github.com/fmtlib/fmt/pull/3210>`_,
294316
`#3240 <https://github.com/fmtlib/fmt/pull/3240>`_,
317+
`#3256 <https://github.com/fmtlib/fmt/pull/3256>`_,
318+
`#3264 <https://github.com/fmtlib/fmt/pull/3264>`_,
295319
`#3299 <https://github.com/fmtlib/fmt/issues/3299>`_,
296320
`#3302 <https://github.com/fmtlib/fmt/pull/3302>`_,
321+
`#3312 <https://github.com/fmtlib/fmt/pull/3312>`_,
297322
`#3317 <https://github.com/fmtlib/fmt/issues/3317>`_,
298323
`#3328 <https://github.com/fmtlib/fmt/pull/3328>`_,
324+
`#3333 <https://github.com/fmtlib/fmt/pull/3333>`_,
325+
`#3369 <https://github.com/fmtlib/fmt/pull/3369>`_,
299326
`#3373 <https://github.com/fmtlib/fmt/issues/3373>`_,
300327
`#3395 <https://github.com/fmtlib/fmt/pull/3395>`_,
301328
`#3406 <https://github.com/fmtlib/fmt/pull/3406>`_,
@@ -304,11 +331,16 @@
304331
`@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
305332
`@DavidKorczynski <https://github.com/DavidKorczynski>`_,
306333
`@ChrisThrasher (Chris Thrasher) <https://github.com/ChrisThrasher>`_,
334+
`@FrancoisCarouge (François Carouge) <https://github.com/FrancoisCarouge>`_,
335+
`@kennyweiss (Kenny Weiss) <https://github.com/kennyweiss>`_,
336+
`@luzpaz <https://github.com/luzpaz>`_,
337+
`@codeinred (Alecto Irene Perez) <https://github.com/codeinred>`_,
338+
`@Mixaill (Mikhail Paulyshka) <https://github.com/Mixaill>`_,
307339
`@joycebrum (Joyce) <https://github.com/joycebrum>`_,
308340
`@kevinhwang (Kevin Hwang) <https://github.com/kevinhwang>`_,
309341
`@Vertexwahn <https://github.com/Vertexwahn>`_.
310342

311-
* Fixed a regression in handling empty format specifiers after a colon (`{:}`)
343+
* Fixed a regression in handling empty format specifiers after a colon (``{:}``)
312344
(`#3086 <https://github.com/fmtlib/fmt/pull/3086>`_).
313345
Thanks `@oxidase (Michael Krasnyk) <https://github.com/oxidase>`_.
314346

@@ -354,11 +386,13 @@
354386
`#3226 <https://github.com/fmtlib/fmt/issues/3226>`_,
355387
`#3228 <https://github.com/fmtlib/fmt/issues/3228>`_,
356388
`#3229 <https://github.com/fmtlib/fmt/pull/3229>`_,
389+
`#3259 <https://github.com/fmtlib/fmt/pull/3259>`_,
357390
`#3274 <https://github.com/fmtlib/fmt/issues/3274>`_,
358391
`#3287 <https://github.com/fmtlib/fmt/issues/3287>`_,
359392
`#3288 <https://github.com/fmtlib/fmt/pull/3288>`_,
360393
`#3292 <https://github.com/fmtlib/fmt/issues/3292>`_,
361394
`#3295 <https://github.com/fmtlib/fmt/pull/3295>`_,
395+
`#3296 <https://github.com/fmtlib/fmt/pull/3296>`_,
362396
`#3298 <https://github.com/fmtlib/fmt/issues/3298>`_,
363397
`#3325 <https://github.com/fmtlib/fmt/issues/3325>`_,
364398
`#3326 <https://github.com/fmtlib/fmt/pull/3326>`_,
@@ -370,6 +404,7 @@
370404
`#3362 <https://github.com/fmtlib/fmt/pull/3362>`_,
371405
`#3365 <https://github.com/fmtlib/fmt/issues/3365>`_,
372406
`#3366 <https://github.com/fmtlib/fmt/pull/3366>`_,
407+
`#3374 <https://github.com/fmtlib/fmt/pull/3374>`_,
373408
`#3377 <https://github.com/fmtlib/fmt/issues/3377>`_,
374409
`#3378 <https://github.com/fmtlib/fmt/pull/3378>`_,
375410
`#3381 <https://github.com/fmtlib/fmt/issues/3381>`_,
@@ -387,8 +422,10 @@
387422
`@Youw (Ihor Dutchak) <https://github.com/Youw>`_,
388423
`@thesmurph <https://github.com/thesmurph>`_,
389424
`@czudziakm (Maksymilian Czudziak) <https://github.com/czudziakm>`_,
425+
`@Roman-Koshelev <https://github.com/Roman-Koshelev>`_,
390426
`@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
391427
`@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_,
428+
`@russelltg (Russell Greene) <https://github.com/russelltg>`_,
392429
`@glebm (Gleb Mazovetskiy) <https://github.com/glebm>`_,
393430
`@tmartin-gh <https://github.com/tmartin-gh>`_,
394431
`@Zhaojun-Liu (June Liu) <https://github.com/Zhaojun-Liu>`_,

doc/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import errno, os, re, sys
55
from subprocess import check_call, CalledProcessError, Popen, PIPE, STDOUT
66

7-
versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0', '6.2.1', '7.0.0', '7.0.1', '7.0.2', '7.0.3', '7.1.0', '7.1.1', '7.1.2', '7.1.3', '8.0.0', '8.0.1', '8.1.0', '8.1.1', '9.0.0', '9.1.0']
7+
versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0', '6.2.1', '7.0.0', '7.0.1', '7.0.2', '7.0.3', '7.1.0', '7.1.1', '7.1.2', '7.1.3', '8.0.0', '8.0.1', '8.1.0', '8.1.1', '9.0.0', '9.1.0', '10.0.0']
88

99
class Pip:
1010
def __init__(self, venv_dir):

include/fmt/core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <type_traits>
1818

1919
// The fmt library version in the form major * 10000 + minor * 100 + patch.
20-
#define FMT_VERSION 90101
20+
#define FMT_VERSION 100000
2121

2222
#if defined(__clang__) && !defined(__ibmxl__)
2323
# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
@@ -175,7 +175,7 @@
175175
#ifndef FMT_BEGIN_NAMESPACE
176176
# define FMT_BEGIN_NAMESPACE \
177177
namespace fmt { \
178-
inline namespace v9 {
178+
inline namespace v10 {
179179
# define FMT_END_NAMESPACE \
180180
} \
181181
}

0 commit comments

Comments
 (0)