Skip to content

Commit

Permalink
wrap fclose() to avoid warning on latest glibc
Browse files Browse the repository at this point in the history
  • Loading branch information
spoonincode committed Sep 5, 2023
1 parent 1ac0605 commit 62de747
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 )>;
static void close_file(FILE* f) {
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 62de747

Please sign in to comment.