From 62de747499b89491ea35b63d19f72ecd61a01747 Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:20:06 -0400 Subject: [PATCH] wrap fclose() to avoid warning on latest glibc --- libraries/libfc/include/fc/io/cfile.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/libfc/include/fc/io/cfile.hpp b/libraries/libfc/include/fc/io/cfile.hpp index c09adf894d..9c9f97e637 100644 --- a/libraries/libfc/include/fc/io/cfile.hpp +++ b/libraries/libfc/include/fc/io/cfile.hpp @@ -19,7 +19,11 @@ namespace fc { namespace detail { - using unique_file = std::unique_ptr; + static void close_file(FILE* f) { + fclose(f); + } + + using unique_file = std::unique_ptr; } class cfile_datastream; @@ -32,7 +36,7 @@ class cfile { friend class temp_cfile; public: cfile() - : _file(nullptr, &fclose) + : _file(nullptr, &detail::close_file) {} cfile(cfile&& other)