aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon <don.j.olmstead@gmail.com>2019-03-12 10:12:18 -0700
committerDon <don.j.olmstead@gmail.com>2019-03-12 10:12:18 -0700
commit795eb4524846be233aa75114d0b2612a75cfd01a (patch)
treef865b31c9cb990284507dfcd7f4774a969a4deda
parentf24bd414ceeed5f4faad80405b87da4394c02d63 (diff)
downloadvcpkg-795eb4524846be233aa75114d0b2612a75cfd01a.tar.gz
vcpkg-795eb4524846be233aa75114d0b2612a75cfd01a.zip
Use feature macro to check for support of filesystem
Rather than defaulting to std::experimental::filesystem in files.h a feature macro can be used to determine what stdfs uses.
-rw-r--r--toolsrc/include/vcpkg/base/files.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h
index b07ff25b3..b4171370f 100644
--- a/toolsrc/include/vcpkg/base/files.h
+++ b/toolsrc/include/vcpkg/base/files.h
@@ -2,7 +2,7 @@
#include <vcpkg/base/expected.h>
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(__cpp_lib_filesystem)
#include <filesystem>
#else
#include <experimental/filesystem>
@@ -10,7 +10,11 @@
namespace fs
{
+#ifdef __cpp_lib_filesystem
+ namespace stdfs = std::filesystem;
+#else
namespace stdfs = std::experimental::filesystem;
+#endif
using stdfs::copy_options;
using stdfs::file_status;