Skip to content

Commit

Permalink
Small mods to mingw changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed May 24, 2024
1 parent 0cee044 commit e381bcc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions epf/Epf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,14 @@ std::vector<FileInfo> Epf::processLas(pdal::LasReader& r, FileInfo fi)
fi.dimInfo.push_back(FileDimInfo(name, type));
}

std::vector<FileInfo> fileInfos;
// If we have LAS start capability, break apart file info into chunks of size 5 million.
#ifdef PDAL_LAS_START
PointCount ChunkSize = 5'000'000;

PointCount remaining = fi.numPoints;
PointId start = 0;

std::vector<FileInfo> fileInfos;
while (remaining)
{
FileInfo lasFi(fi);
Expand All @@ -485,7 +485,7 @@ std::vector<FileInfo> Epf::processLas(pdal::LasReader& r, FileInfo fi)
remaining -= lasFi.numPoints;
}
#else
fileInfos.push_back(fileInfo);
fileInfos.push_back(fi);
#endif
return fileInfos;
}
Expand Down
16 changes: 5 additions & 11 deletions untwine/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ MapContext mapFile(const std::string& filename, bool readOnly, size_t pos, size_
return ctx;
}

#ifndef _WIN32
ctx.m_fd = ::open(filename.data(), readOnly ? O_RDONLY : O_RDWR);
#else
#ifdef _MSC_VER
#if defined(_MSC_VER) // Windows
ctx.m_fd = ::_wopen(toNative(filename).data(), readOnly ? _O_RDONLY : _O_RDWR);
#else
#elif defined(_WIN32) // MinGW
ctx.m_fd = ::_open(toNative(filename).data(), readOnly ? _O_RDONLY : _O_RDWR);
#endif
#else // Everyone else
ctx.m_fd = ::open(filename.data(), readOnly ? O_RDONLY : O_RDWR);
#endif

if (ctx.m_fd == -1)
Expand Down Expand Up @@ -133,11 +131,7 @@ std::vector<std::string> directoryList(const std::string& dir)
fs::directory_iterator end;
while (it != end)
{
#ifndef __MINGW32__
files.push_back(untwine::fromNative(it->path()));
#else
files.push_back(untwine::fromNative(it->path().string()));
#endif
files.push_back(it->path().string());
it++;
}
}
Expand Down

0 comments on commit e381bcc

Please sign in to comment.