aboutsummaryrefslogtreecommitdiff
path: root/dep/fmt/src/os.cc
diff options
context:
space:
mode:
authorPeter Keresztes Schmidt <carbenium@outlook.com>2021-08-15 13:22:18 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-12 23:52:29 +0100
commit92a89ab6f3446d77f896ad585b3b2c8c235b7228 (patch)
tree870e4f4cef6a23a9e2bff8c14fa08cb045f6f1f4 /dep/fmt/src/os.cc
parent105e2e33581ebd996ab71e78aa0501a44bc8d50b (diff)
Dep/fmt: Upgrade to 7.1.3 (#26816)
Printing enum values as integers was broken before 7.1.0. Upgrade the library so we include commits https://github.com/fmtlib/fmt/commit/20d4f2e83677be035a15693127e404c4a5d68ac9 https://github.com/fmtlib/fmt/commit/86287b8d5625ef390da6ef10fc77a872b8ad41ac which fix the issue. (cherry picked from commit 8a4844e029a12cb4dcaf361a3177559e19f94f12)
Diffstat (limited to 'dep/fmt/src/os.cc')
-rw-r--r--dep/fmt/src/os.cc17
1 files changed, 11 insertions, 6 deletions
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