Skip to content

Commit

Permalink
Merge pull request #3024 from JasonRuonanWang/master
Browse files Browse the repository at this point in the history
fix compile error newly introduced
  • Loading branch information
pnorbert authored Jan 28, 2022
2 parents cc8cc26 + cc95a7e commit 6fa3443
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions source/adios2/toolkit/transport/file/FileFStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include <ios> // std::ios_base::failure
/// \endcond

#if __cplusplus >= 201703L
#include <filesystem>
#endif

namespace adios2
{
namespace transport
Expand Down Expand Up @@ -354,19 +358,16 @@ void FileFStream::Seek(const size_t start)
}
}

#if __cplusplus >= 201703L
#include <filesystem>
#endif

void FileFStream::Truncate(const size_t length)
{
#if __cplusplus >= 201703L
// C++17 specific stuff here
WaitForOpen();
std::filesystem::path p(m_Name);
std::filesystem::resize_file(p, static_cast<std::uintmax_t>(length));
CheckFile("couldn't move to offset " + std::to_string(start) + " of file " +
m_Name + ", in call to fstream seekp");
// TODO: variable start has not been defined...
// CheckFile("couldn't move to offset " + std::to_string(start) + " of file
// " + m_Name + ", in call to fstream seekp");
#else
// Trunation is not supported in a portable manner pre C++17
#endif
Expand Down

0 comments on commit 6fa3443

Please sign in to comment.