From 413240cc097d48190b030e24f5c360cd5b56355c Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Thu, 29 Oct 2015 18:24:38 +0100 Subject: [PATCH] WinCE has no current directory So reject attempts to change it and treat the root as the current directory. --- include/boost/filesystem/path.hpp | 3 ++- src/operations.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/boost/filesystem/path.hpp b/include/boost/filesystem/path.hpp index 9c6e32a4..b643b7f0 100644 --- a/include/boost/filesystem/path.hpp +++ b/include/boost/filesystem/path.hpp @@ -526,7 +526,8 @@ namespace filesystem bool is_relative() const { return !is_absolute(); } bool is_absolute() const { -# ifdef BOOST_WINDOWS_API + // Windows CE has no root name (aka driver letters) +# if defined(BOOST_WINDOWS_API) && !defined(UNDER_CE) return has_root_name() && has_root_directory(); # else return has_root_directory(); diff --git a/src/operations.cpp b/src/operations.cpp index f34b0761..3f38a244 100644 --- a/src/operations.cpp +++ b/src/operations.cpp @@ -1101,6 +1101,9 @@ namespace detail } return cur; +# elif defined(UNDER_CE) + // Windows CE has no current directory, so everything's relative to the root of the directory tree + return L"\\"; # else DWORD sz; if ((sz = ::GetCurrentDirectoryW(0, NULL)) == 0)sz = 1; @@ -1115,8 +1118,13 @@ namespace detail BOOST_FILESYSTEM_DECL void current_path(const path& p, system::error_code* ec) { +# ifdef UNDER_CE + error(BOOST_ERROR_NOT_SUPPORTED, p, ec, + "boost::filesystem::current_path"); +# else error(!BOOST_SET_CURRENT_DIRECTORY(p.c_str()) ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::current_path"); +# endif } BOOST_FILESYSTEM_DECL