aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/filesystem.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-05-13 12:00:58 -0400
committerJack Lloyd <[email protected]>2018-05-13 12:01:30 -0400
commit85aa2ad493b0352e940ef7b1756a5c858c857488 (patch)
tree9004d69126b34913cbf9fb2bb51ee03347e11579 /src/lib/utils/filesystem.cpp
parentbef5303b3ec1a17bc79ccce0eecdca4874639b56 (diff)
Fixes for compilation in C++17 mode by MSVC
Fixes GH #1566
Diffstat (limited to 'src/lib/utils/filesystem.cpp')
-rw-r--r--src/lib/utils/filesystem.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/utils/filesystem.cpp b/src/lib/utils/filesystem.cpp
index 9ce23d0c6..fbfafdf5b 100644
--- a/src/lib/utils/filesystem.cpp
+++ b/src/lib/utils/filesystem.cpp
@@ -35,17 +35,21 @@ namespace {
#if defined(BOTAN_TARGET_OS_HAS_STL_FILESYSTEM_MSVC) && defined(BOTAN_BUILD_COMPILER_IS_MSVC)
std::vector<std::string> impl_stl_filesystem(const std::string& dir)
{
+#if (_MSVC_LANG >= 201703L)
+ using namespace std::filesystem;
+#else
using namespace std::tr2::sys;
+#endif
std::vector<std::string> out;
path p(dir);
- if (is_directory(p))
+ if(is_directory(p))
{
- for (recursive_directory_iterator itr(p), end; itr != end; ++itr)
+ for(recursive_directory_iterator itr(p), end; itr != end; ++itr)
{
- if (is_regular_file(itr->path()))
+ if(is_regular_file(itr->path()))
{
out.push_back(itr->path().string());
}