Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrap cfile's fclose() to avoid warning on latest glibc #1592

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions libraries/libfc/include/fc/io/cfile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
namespace fc {

namespace detail {
using unique_file = std::unique_ptr<FILE, decltype( &fclose )>;
inline void close_file(FILE* f) noexcept {
fclose(f);
}

using unique_file = std::unique_ptr<FILE, decltype( &close_file )>;
}

class cfile_datastream;
Expand All @@ -32,7 +36,7 @@ class cfile {
friend class temp_cfile;
public:
cfile()
: _file(nullptr, &fclose)
: _file(nullptr, &detail::close_file)
{}

cfile(cfile&& other)
Expand Down