Skip to content

Commit 9e7a008

Browse files
committed
Update fmt-11.0.1, simdjson-3.9.5
1 parent 87dd5ab commit 9e7a008

File tree

9 files changed

+163
-94
lines changed

9 files changed

+163
-94
lines changed

3rdparty/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
## {fmt}
6464
- [![Upstream](https://img.shields.io/github/v/release/fmtlib/fmt?label=Upstream)](https://github.com/fmtlib/fmt)
65-
- Version: 11.0.0
65+
- Version: 11.0.1
6666
- License: MIT
6767

6868
## FreeType
@@ -213,7 +213,7 @@
213213

214214
## simdjson
215215
- [![Upstream](https://img.shields.io/github/v/tag/simdjson/simdjson?label=Upstream)](https://github.com/simdjson/simdjson)
216-
- Version: 3.9.4
216+
- Version: 3.9.5
217217
- License: Apache-2.0
218218

219219
## stb (stb_image)

3rdparty/fmt/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,14 @@ endif ()
355355
add_library(fmt-header-only INTERFACE)
356356
add_library(fmt::fmt-header-only ALIAS fmt-header-only)
357357

358-
if (MSVC AND FMT_UNICODE)
358+
if (NOT MSVC)
359+
# Unicode is always supported on compilers other than MSVC.
360+
elseif (FMT_UNICODE)
359361
# Unicode support requires compiling with /utf-8.
360362
target_compile_options(fmt PUBLIC $<$<COMPILE_LANGUAGE:CXX>:/utf-8>)
361363
target_compile_options(fmt-header-only INTERFACE $<$<COMPILE_LANGUAGE:CXX>:/utf-8>)
364+
else ()
365+
target_compile_definitions(fmt PUBLIC FMT_UNICODE=0)
362366
endif ()
363367

364368
target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1)

3rdparty/fmt/ChangeLog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# 11.0.1 - 2024-07-05
2+
3+
- Fixed version number in the inline namespace
4+
(https://github.com/fmtlib/fmt/issues/4047).
5+
6+
- Fixed disabling Unicode support via CMake
7+
(https://github.com/fmtlib/fmt/issues/4051).
8+
9+
- Fixed deprecated `visit_format_arg` (https://github.com/fmtlib/fmt/pull/4043).
10+
Thanks @nebkat.
11+
12+
- Fixed handling of a sign and improved the `std::complex` formater
13+
(https://github.com/fmtlib/fmt/pull/4034,
14+
https://github.com/fmtlib/fmt/pull/4050). Thanks @tesch1 and @phprus.
15+
16+
- Removed a redundant check in the formatter for `std::expected`
17+
(https://github.com/fmtlib/fmt/pull/4040). Thanks @phprus.
18+
119
# 11.0.0 - 2024-07-01
220

321
- Added `fmt/base.h` which provides a subset of the API with minimal include

3rdparty/fmt/include/fmt/base.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#endif
2424

2525
// The fmt library version in the form major * 10000 + minor * 100 + patch.
26-
#define FMT_VERSION 110000
26+
#define FMT_VERSION 110001
2727

2828
// Detect compiler versions.
2929
#if defined(__clang__) && !defined(__ibmxl__)
@@ -262,7 +262,7 @@
262262
#ifndef FMT_BEGIN_NAMESPACE
263263
# define FMT_BEGIN_NAMESPACE \
264264
namespace fmt { \
265-
inline namespace v10 {
265+
inline namespace v11 {
266266
# define FMT_END_NAMESPACE \
267267
} \
268268
}
@@ -1760,7 +1760,7 @@ template <typename Context> class basic_format_arg {
17601760
* `vis(value)` will be called with the value of type `double`.
17611761
*/
17621762
template <typename Visitor>
1763-
FMT_CONSTEXPR auto visit(Visitor&& vis) -> decltype(vis(0)) {
1763+
FMT_CONSTEXPR auto visit(Visitor&& vis) const -> decltype(vis(0)) {
17641764
switch (type_) {
17651765
case detail::type::none_type:
17661766
break;

3rdparty/fmt/include/fmt/printf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,8 @@ using wprintf_args = basic_format_args<wprintf_context>;
569569
/// arguments and can be implicitly converted to `printf_args`.
570570
template <typename Char = char, typename... T>
571571
inline auto make_printf_args(T&... args)
572-
-> decltype(make_format_args<basic_printf_context<Char>>(args...)) {
573-
return make_format_args<basic_printf_context<Char>>(args...);
572+
-> decltype(fmt::make_format_args<basic_printf_context<Char>>(args...)) {
573+
return fmt::make_format_args<basic_printf_context<Char>>(args...);
574574
}
575575

576576
template <typename Char> struct vprintf_args {

3rdparty/fmt/include/fmt/std.h

Lines changed: 56 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ struct formatter<std::expected<T, E>, Char,
291291

292292
if (value.has_value()) {
293293
out = detail::write<Char>(out, "expected(");
294-
out = detail::write_escaped_alternative<Char>(out, value.value());
294+
out = detail::write_escaped_alternative<Char>(out, *value);
295295
} else {
296296
out = detail::write<Char>(out, "unexpected(");
297297
out = detail::write_escaped_alternative<Char>(out, value.error());
@@ -631,33 +631,67 @@ struct formatter<std::atomic_flag, Char> : formatter<bool, Char> {
631631
#endif // __cpp_lib_atomic_flag_test
632632

633633
FMT_EXPORT
634-
template <typename F, typename Char>
635-
struct formatter<std::complex<F>, Char> : nested_formatter<F, Char> {
634+
template <typename T, typename Char> struct formatter<std::complex<T>, Char> {
636635
private:
637-
// Functor because C++11 doesn't support generic lambdas.
638-
struct writer {
639-
const formatter<std::complex<F>, Char>* f;
640-
const std::complex<F>& c;
641-
642-
template <typename OutputIt>
643-
FMT_CONSTEXPR auto operator()(OutputIt out) -> OutputIt {
644-
if (c.real() != 0) {
645-
auto format_full = detail::string_literal<Char, '(', '{', '}', '+', '{',
646-
'}', 'i', ')'>{};
647-
return fmt::format_to(out, basic_string_view<Char>(format_full),
648-
f->nested(c.real()), f->nested(c.imag()));
649-
}
650-
auto format_imag = detail::string_literal<Char, '{', '}', 'i'>{};
651-
return fmt::format_to(out, basic_string_view<Char>(format_imag),
652-
f->nested(c.imag()));
636+
detail::dynamic_format_specs<Char> specs_;
637+
638+
template <typename FormatContext, typename OutputIt>
639+
FMT_CONSTEXPR auto do_format(const std::complex<T>& c,
640+
detail::dynamic_format_specs<Char>& specs,
641+
FormatContext& ctx, OutputIt out) const
642+
-> OutputIt {
643+
if (c.real() != 0) {
644+
*out++ = Char('(');
645+
out = detail::write<Char>(out, c.real(), specs, ctx.locale());
646+
specs.sign = sign::plus;
647+
out = detail::write<Char>(out, c.imag(), specs, ctx.locale());
648+
if (!detail::isfinite(c.imag())) *out++ = Char(' ');
649+
*out++ = Char('i');
650+
*out++ = Char(')');
651+
return out;
653652
}
654-
};
653+
out = detail::write<Char>(out, c.imag(), specs, ctx.locale());
654+
if (!detail::isfinite(c.imag())) *out++ = Char(' ');
655+
*out++ = Char('i');
656+
return out;
657+
}
655658

656659
public:
660+
FMT_CONSTEXPR auto parse(basic_format_parse_context<Char>& ctx)
661+
-> decltype(ctx.begin()) {
662+
if (ctx.begin() == ctx.end() || *ctx.begin() == '}') return ctx.begin();
663+
return parse_format_specs(ctx.begin(), ctx.end(), specs_, ctx,
664+
detail::type_constant<T, Char>::value);
665+
}
666+
657667
template <typename FormatContext>
658-
auto format(const std::complex<F>& c, FormatContext& ctx) const
668+
auto format(const std::complex<T>& c, FormatContext& ctx) const
659669
-> decltype(ctx.out()) {
660-
return this->write_padded(ctx, writer{this, c});
670+
auto specs = specs_;
671+
if (specs.width_ref.kind != detail::arg_id_kind::none ||
672+
specs.precision_ref.kind != detail::arg_id_kind::none) {
673+
detail::handle_dynamic_spec<detail::width_checker>(specs.width,
674+
specs.width_ref, ctx);
675+
detail::handle_dynamic_spec<detail::precision_checker>(
676+
specs.precision, specs.precision_ref, ctx);
677+
}
678+
679+
if (specs.width == 0) return do_format(c, specs, ctx, ctx.out());
680+
auto buf = basic_memory_buffer<Char>();
681+
682+
auto outer_specs = format_specs();
683+
outer_specs.width = specs.width;
684+
outer_specs.fill = specs.fill;
685+
outer_specs.align = specs.align;
686+
687+
specs.width = 0;
688+
specs.fill = {};
689+
specs.align = align::none;
690+
691+
do_format(c, specs, ctx, basic_appender<Char>(buf));
692+
return detail::write<Char>(ctx.out(),
693+
basic_string_view<Char>(buf.data(), buf.size()),
694+
outer_specs);
661695
}
662696
};
663697

3rdparty/simdjson/simdjson.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2024-06-11 14:08:20 -0400. Do not edit! */
1+
/* auto-generated on 2024-07-04 16:26:22 -0400. Do not edit! */
22
/* including simdjson.cpp: */
33
/* begin file simdjson.cpp */
44
#define SIMDJSON_SRC_SIMDJSON_CPP
@@ -224,6 +224,11 @@ using std::size_t;
224224
#define SIMDJSON_NO_SANITIZE_UNDEFINED
225225
#endif
226226

227+
#if defined(__clang__) || defined(__GNUC__)
228+
#define simdjson_pure [[gnu::pure]]
229+
#else
230+
#define simdjson_pure
231+
#endif
227232

228233
#if defined(__clang__) || defined(__GNUC__)
229234
#if defined(__has_feature)
@@ -6020,14 +6025,14 @@ class dom_parser_implementation {
60206025
*
60216026
* @return Current capacity, in bytes.
60226027
*/
6023-
simdjson_inline size_t capacity() const noexcept;
6028+
simdjson_pure simdjson_inline size_t capacity() const noexcept;
60246029

60256030
/**
60266031
* The maximum level of nested object and arrays supported by this parser.
60276032
*
60286033
* @return Maximum depth, in bytes.
60296034
*/
6030-
simdjson_inline size_t max_depth() const noexcept;
6035+
simdjson_pure simdjson_inline size_t max_depth() const noexcept;
60316036

60326037
/**
60336038
* Ensure this parser has enough memory to process JSON documents up to `capacity` bytes in length
@@ -6068,11 +6073,11 @@ simdjson_inline dom_parser_implementation::dom_parser_implementation() noexcept
60686073
simdjson_inline dom_parser_implementation::dom_parser_implementation(dom_parser_implementation &&other) noexcept = default;
60696074
simdjson_inline dom_parser_implementation &dom_parser_implementation::operator=(dom_parser_implementation &&other) noexcept = default;
60706075

6071-
simdjson_inline size_t dom_parser_implementation::capacity() const noexcept {
6076+
simdjson_pure simdjson_inline size_t dom_parser_implementation::capacity() const noexcept {
60726077
return _capacity;
60736078
}
60746079

6075-
simdjson_inline size_t dom_parser_implementation::max_depth() const noexcept {
6080+
simdjson_pure simdjson_inline size_t dom_parser_implementation::max_depth() const noexcept {
60766081
return _max_depth;
60776082
}
60786083

0 commit comments

Comments
 (0)