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

fix compile error newly introduced #3024

Merged
merged 1 commit into from
Jan 28, 2022
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
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