File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77#include <ios>
88#include <istream>
99
10+ #ifdef __GLIBCXX__
11+ #include <ext/stdio_filebuf.h>
12+ #endif
13+
1014namespace tmp {
1115
1216/// tmp::file is a smart handle that manages a temporary file, ensuring
@@ -85,10 +89,15 @@ public:
8589
8690private:
8791 /// The underlying C file stream
88- std::unique_ptr<std::FILE, decltype(& std::fclose )> underlying;
92+ std::unique_ptr<std::FILE, int(*)( std::FILE* )> underlying;
8993
94+ #ifdef __GLIBCXX__
95+ /// The underlying raw file device object
96+ mutable __gnu_cxx::stdio_filebuf<char> sb;
97+ #else
9098 /// The underlying raw file device object
9199 std::filebuf sb;
100+ #endif
92101};
93102} // namespace tmp
94103
Original file line number Diff line number Diff line change @@ -217,7 +217,6 @@ file::file(std::ios::openmode mode)
217217#elif defined(_LIBCPP_VERSION)
218218 sb.__open (fileno (underlying.get ()), mode);
219219#else
220- static_assert (sizeof (std::filebuf) == sizeof (__gnu_cxx::stdio_filebuf<char >));
221220 sb = __gnu_cxx::stdio_filebuf<char >(underlying.get (), mode);
222221#endif
223222
You can’t perform that action at this time.
0 commit comments