update fmtlib to version 7.1.3
This commit is contained in:
committed by
Richard Berger
parent
2868f37304
commit
82703e5bac
@ -18,7 +18,7 @@
|
||||
#include <vector>
|
||||
|
||||
// The fmt library version in the form major * 10000 + minor * 100 + patch.
|
||||
#define FMT_VERSION 70102
|
||||
#define FMT_VERSION 70103
|
||||
|
||||
#ifdef __clang__
|
||||
# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
|
||||
@ -769,7 +769,7 @@ class fixed_buffer_traits {
|
||||
explicit fixed_buffer_traits(size_t limit) : limit_(limit) {}
|
||||
size_t count() const { return count_; }
|
||||
size_t limit(size_t size) {
|
||||
size_t n = limit_ - count_;
|
||||
size_t n = limit_ > count_ ? limit_ - count_ : 0;
|
||||
count_ += size;
|
||||
return size < n ? size : n;
|
||||
}
|
||||
@ -792,7 +792,7 @@ class iterator_buffer final : public Traits, public buffer<T> {
|
||||
public:
|
||||
explicit iterator_buffer(OutputIt out, size_t n = buffer_size)
|
||||
: Traits(n),
|
||||
buffer<T>(data_, 0, n < size_t(buffer_size) ? n : size_t(buffer_size)),
|
||||
buffer<T>(data_, 0, buffer_size),
|
||||
out_(out) {}
|
||||
~iterator_buffer() { flush(); }
|
||||
|
||||
|
||||
@ -1145,8 +1145,8 @@ template <typename T = void> struct null {};
|
||||
template <typename Char> struct fill_t {
|
||||
private:
|
||||
enum { max_size = 4 };
|
||||
Char data_[max_size];
|
||||
unsigned char size_;
|
||||
Char data_[max_size] = {Char(' '), Char(0), Char(0), Char(0)};
|
||||
unsigned char size_ = 1;
|
||||
|
||||
public:
|
||||
FMT_CONSTEXPR void operator=(basic_string_view<Char> s) {
|
||||
@ -1166,13 +1166,6 @@ template <typename Char> struct fill_t {
|
||||
FMT_CONSTEXPR const Char& operator[](size_t index) const {
|
||||
return data_[index];
|
||||
}
|
||||
|
||||
static FMT_CONSTEXPR fill_t<Char> make() {
|
||||
auto fill = fill_t<Char>();
|
||||
fill[0] = Char(' ');
|
||||
fill.size_ = 1;
|
||||
return fill;
|
||||
}
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
@ -1204,8 +1197,7 @@ template <typename Char> struct basic_format_specs {
|
||||
type(0),
|
||||
align(align::none),
|
||||
sign(sign::none),
|
||||
alt(false),
|
||||
fill(detail::fill_t<Char>::make()) {}
|
||||
alt(false) {}
|
||||
};
|
||||
|
||||
using format_specs = basic_format_specs<char>;
|
||||
@ -1274,7 +1266,7 @@ template <typename T> struct decimal_fp {
|
||||
int exponent;
|
||||
};
|
||||
|
||||
template <typename T> decimal_fp<T> to_decimal(T x) FMT_NOEXCEPT;
|
||||
template <typename T> FMT_API decimal_fp<T> to_decimal(T x) FMT_NOEXCEPT;
|
||||
} // namespace dragonbox
|
||||
|
||||
template <typename T>
|
||||
|
||||
@ -388,7 +388,7 @@ class ostream final : private detail::buffer<char> {
|
||||
clear();
|
||||
}
|
||||
|
||||
void grow(size_t) final;
|
||||
FMT_API void grow(size_t) override final;
|
||||
|
||||
ostream(cstring_view path, const detail::ostream_params& params)
|
||||
: file_(path, params.oflag) {
|
||||
|
||||
@ -254,7 +254,10 @@ struct formatter<
|
||||
enable_if_t<fmt::is_range<T, Char>::value
|
||||
// Workaround a bug in MSVC 2017 and earlier.
|
||||
#if !FMT_MSC_VER || FMT_MSC_VER >= 1927
|
||||
&& has_formatter<detail::value_type<T>, format_context>::value
|
||||
&&
|
||||
(has_formatter<detail::value_type<T>, format_context>::value ||
|
||||
detail::has_fallback_formatter<detail::value_type<T>,
|
||||
format_context>::value)
|
||||
#endif
|
||||
>> {
|
||||
formatting_range<Char> formatting;
|
||||
|
||||
@ -24,9 +24,9 @@ int format_float(char* buf, std::size_t size, const char* format, int precision,
|
||||
: snprintf_ptr(buf, size, format, precision, value);
|
||||
}
|
||||
|
||||
template dragonbox::decimal_fp<float> dragonbox::to_decimal(float x)
|
||||
template FMT_API dragonbox::decimal_fp<float> dragonbox::to_decimal(float x)
|
||||
FMT_NOEXCEPT;
|
||||
template dragonbox::decimal_fp<double> dragonbox::to_decimal(double x)
|
||||
template FMT_API dragonbox::decimal_fp<double> dragonbox::to_decimal(double x)
|
||||
FMT_NOEXCEPT;
|
||||
|
||||
// DEPRECATED! This function exists for ABI compatibility.
|
||||
|
||||
@ -315,7 +315,7 @@ long getpagesize() {
|
||||
# endif
|
||||
}
|
||||
|
||||
void ostream::grow(size_t) {
|
||||
FMT_API void ostream::grow(size_t) {
|
||||
if (this->size() == this->capacity()) flush();
|
||||
}
|
||||
#endif // FMT_USE_FCNTL
|
||||
|
||||
Reference in New Issue
Block a user