From f449ca0525098380e0caff6c452c617b3d58879b Mon Sep 17 00:00:00 2001 From: Daniela Engert Date: Sun, 23 Apr 2023 16:10:57 +0200 Subject: [PATCH] Name `vfprintf` clashes with the identically named declaration in 'stdio.h' if that happens to be #included into the same TU. Fix this by using qualified name lookup instead of unqualified lookup that also enables ADL. (#3400) --- include/fmt/printf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/printf.h b/include/fmt/printf.h index 25e93bb3..554715e9 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -599,7 +599,7 @@ inline auto vsprintf( basic_format_args>> args) -> std::basic_string { auto buf = basic_memory_buffer(); - vprintf(buf, detail::to_string_view(fmt), args); + detail::vprintf(buf, detail::to_string_view(fmt), args); return to_string(buf); } @@ -626,7 +626,7 @@ inline auto vfprintf( basic_format_args>> args) -> int { auto buf = basic_memory_buffer(); - vprintf(buf, detail::to_string_view(fmt), args); + detail::vprintf(buf, detail::to_string_view(fmt), args); size_t size = buf.size(); return std::fwrite(buf.data(), sizeof(Char), size, f) < size ? -1