From 57952505e522be868a5a8270d8670163b55ebade Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Tue, 5 May 2020 22:52:14 +0100 Subject: Update fmt to 6.2.0 (#4718) * Update fmt to 6.2.0 --- src/OSSupport/File.cpp | 7 ++++--- src/OSSupport/File.h | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/OSSupport') diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp index 3dd97f36c..e882daae7 100644 --- a/src/OSSupport/File.cpp +++ b/src/OSSupport/File.cpp @@ -692,10 +692,11 @@ AString cFile::GetExecutableExt(void) -int cFile::Printf(const char * a_Fmt, fmt::ArgList a_ArgList) +int cFile::vPrintf(const char * a_Fmt, fmt::printf_args a_ArgList) { - AString buf = ::Printf(a_Fmt, a_ArgList); - return Write(buf.c_str(), buf.length()); + fmt::memory_buffer Buffer; + fmt::printf(Buffer, fmt::to_string_view(a_Fmt), a_ArgList); + return Write(Buffer.data(), Buffer.size()); } diff --git a/src/OSSupport/File.h b/src/OSSupport/File.h index 59bb61974..0bb877186 100644 --- a/src/OSSupport/File.h +++ b/src/OSSupport/File.h @@ -163,8 +163,12 @@ public: /** Returns the list of all items in the specified folder (files, folders, nix pipes, whatever's there). */ static AStringVector GetFolderContents(const AString & a_Folder); // Exported in ManualBindings.cpp - int Printf(const char * a_Fmt, fmt::ArgList); - FMT_VARIADIC(int, Printf, const char *) + int vPrintf(const char * a_Fmt, fmt::printf_args); + template + int Printf(const char * a_Fmt, const Args & ... a_Args) + { + return vPrintf(a_Fmt, fmt::make_printf_args(a_Args...)); + } /** Flushes all the bufferef output into the file (only when writing) */ void Flush(void); -- cgit v1.2.3