[wpiutil] Upgrade to fmt 9.0.0 (#4337)

fmt removed fmt::make_args_checked since it's no longer needed for
constexpr format string checks.

fmt deprecated implicit conversions from enums to integers in format
arguments, so I added explicit static casts.
This commit is contained in:
Tyler Veness
2022-08-16 15:35:26 -07:00
committed by GitHub
parent 340465c929
commit 151dabb2af
38 changed files with 3522 additions and 3364 deletions

View File

@@ -1,33 +1,34 @@
From e92e91d28f2475b38f32f92d24b65eec195254a6 Mon Sep 17 00:00:00 2001
From 6742d9385ef8ce677549186cde50c6173d503fac Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Wed, 18 May 2022 10:21:49 -0700
Subject: [PATCH] Don't throw on write failure
---
include/fmt/format-inl.h | 3 +--
include/fmt/format-inl.h | 4 +---
include/fmt/xchar.h | 3 +--
src/os.cc | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h
index 2c51c50a..cc89abdd 100644
index f44df01c..d8906c9a 100644
--- a/include/fmt/format-inl.h
+++ b/include/fmt/format-inl.h
@@ -92,8 +92,7 @@ FMT_FUNC void report_error(format_func func, int error_code,
@@ -79,9 +79,7 @@ FMT_FUNC void report_error(format_func func, int error_code,
// A wrapper around fwrite that throws on error.
inline void fwrite_fully(const void* ptr, size_t size, size_t count,
FILE* stream) {
- size_t written = std::fwrite(ptr, size, count, stream);
- if (written < count) FMT_THROW(system_error(errno, "cannot write to file"));
- if (written < count)
- FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
+ std::fwrite(ptr, size, count, stream);
}
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
diff --git a/include/fmt/xchar.h b/include/fmt/xchar.h
index 55825077..9acb893f 100644
index 2865b76e..5a062e80 100644
--- a/include/fmt/xchar.h
+++ b/include/fmt/xchar.h
@@ -207,8 +207,7 @@ inline void vprint(std::FILE* f, wstring_view fmt, wformat_args args) {
@@ -203,8 +203,7 @@ inline void vprint(std::FILE* f, wstring_view fmt, wformat_args args) {
wmemory_buffer buffer;
detail::vformat_to(buffer, fmt, args);
buffer.push_back(L'\0');
@@ -38,7 +39,7 @@ index 55825077..9acb893f 100644
inline void vprint(wstring_view fmt, wformat_args args) {
diff --git a/src/os.cc b/src/os.cc
index 04b4dc50..4eb3e1fd 100644
index f388ead0..2c499512 100644
--- a/src/os.cc
+++ b/src/os.cc
@@ -277,8 +277,7 @@ std::size_t file::read(void* buffer, std::size_t count) {

View File

@@ -12,7 +12,7 @@ from upstream_utils import (
def main():
root, repo = setup_upstream_repo("https://github.com/fmtlib/fmt", "8.1.1")
root, repo = setup_upstream_repo("https://github.com/fmtlib/fmt", "9.0.0")
wpiutil = os.path.join(root, "wpiutil")
# Apply patches to original git repo