aboutsummaryrefslogtreecommitdiff
path: root/dep/fmt/src
diff options
context:
space:
mode:
Diffstat (limited to 'dep/fmt/src')
-rw-r--r--dep/fmt/src/format.cc34
-rw-r--r--dep/fmt/src/os.cc17
2 files changed, 43 insertions, 8 deletions
diff --git a/dep/fmt/src/format.cc b/dep/fmt/src/format.cc
index a64a1f3893a..6141d964a79 100644
--- a/dep/fmt/src/format.cc
+++ b/dep/fmt/src/format.cc
@@ -23,6 +23,36 @@ int format_float(char* buf, std::size_t size, const char* format, int precision,
return precision < 0 ? snprintf_ptr(buf, size, format, value)
: snprintf_ptr(buf, size, format, precision, value);
}
+
+template FMT_API dragonbox::decimal_fp<float> dragonbox::to_decimal(float x)
+ FMT_NOEXCEPT;
+template FMT_API dragonbox::decimal_fp<double> dragonbox::to_decimal(double x)
+ FMT_NOEXCEPT;
+
+// DEPRECATED! This function exists for ABI compatibility.
+template <typename Char>
+typename basic_format_context<std::back_insert_iterator<buffer<Char>>,
+ Char>::iterator
+vformat_to(buffer<Char>& buf, basic_string_view<Char> format_str,
+ basic_format_args<basic_format_context<
+ std::back_insert_iterator<buffer<type_identity_t<Char>>>,
+ type_identity_t<Char>>>
+ args) {
+ using iterator = std::back_insert_iterator<buffer<char>>;
+ using context = basic_format_context<
+ std::back_insert_iterator<buffer<type_identity_t<Char>>>,
+ type_identity_t<Char>>;
+ auto out = iterator(buf);
+ format_handler<iterator, Char, context> h(out, format_str, args, {});
+ parse_format_string<false>(format_str, h);
+ return out;
+}
+template basic_format_context<std::back_insert_iterator<buffer<char>>,
+ char>::iterator
+vformat_to(buffer<char>&, string_view,
+ basic_format_args<basic_format_context<
+ std::back_insert_iterator<buffer<type_identity_t<char>>>,
+ type_identity_t<char>>>);
} // namespace detail
template struct FMT_INSTANTIATION_DEF_API detail::basic_data<void>;
@@ -44,9 +74,9 @@ template FMT_API char detail::decimal_point_impl(locale_ref);
template FMT_API void detail::buffer<char>::append(const char*, const char*);
-template FMT_API FMT_BUFFER_CONTEXT(char)::iterator detail::vformat_to(
+template FMT_API void detail::vformat_to(
detail::buffer<char>&, string_view,
- basic_format_args<FMT_BUFFER_CONTEXT(char)>);
+ basic_format_args<FMT_BUFFER_CONTEXT(char)>, detail::locale_ref);
template FMT_API int detail::snprintf_float(double, int, detail::float_specs,
detail::buffer<char>&);
diff --git a/dep/fmt/src/os.cc b/dep/fmt/src/os.cc
index 386119db175..6850024588f 100644
--- a/dep/fmt/src/os.cc
+++ b/dep/fmt/src/os.cc
@@ -62,7 +62,7 @@ using RWResult = int;
inline unsigned convert_rwcount(std::size_t count) {
return count <= UINT_MAX ? static_cast<unsigned>(count) : UINT_MAX;
}
-#else
+#elif FMT_USE_FCNTL
// Return type of read and write functions.
using RWResult = ssize_t;
@@ -124,7 +124,8 @@ void detail::format_windows_error(detail::buffer<char>& out, int error_code,
if (result != 0) {
utf16_to_utf8 utf8_message;
if (utf8_message.convert(system_message) == ERROR_SUCCESS) {
- format_to(std::back_inserter(out), "{}: {}", message, utf8_message);
+ format_to(buffer_appender<char>(out), "{}: {}", message,
+ utf8_message);
return;
}
break;
@@ -288,12 +289,12 @@ void file::pipe(file& read_end, file& write_end) {
}
buffered_file file::fdopen(const char* mode) {
- // Don't retry as fdopen doesn't return EINTR.
- #if defined(__MINGW32__) && defined(_POSIX_)
+// Don't retry as fdopen doesn't return EINTR.
+# if defined(__MINGW32__) && defined(_POSIX_)
FILE* f = ::fdopen(fd_, mode);
- #else
+# else
FILE* f = FMT_POSIX_CALL(fdopen(fd_, mode));
- #endif
+# endif
if (!f)
FMT_THROW(
system_error(errno, "cannot associate stream with file descriptor"));
@@ -313,5 +314,9 @@ long getpagesize() {
return size;
# endif
}
+
+FMT_API void ostream::grow(size_t) {
+ if (this->size() == this->capacity()) flush();
+}
#endif // FMT_USE_FCNTL
FMT_END_NAMESPACE