Skip to content

Commit

Permalink
Merge pull request #1592 from AntelopeIO/cfile_warn_be_gone
Browse files Browse the repository at this point in the history
wrap `cfile`'s `fclose()` to avoid warning on latest glibc
  • Loading branch information
spoonincode authored Sep 5, 2023
2 parents 1adff8e + 3b29ca4 commit 409eb59
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 409eb59

Please sign in to comment.