diff --git a/doc/release_history.html b/doc/release_history.html index b80a0f4..2d98104 100644 --- a/doc/release_history.html +++ b/doc/release_history.html @@ -40,6 +40,11 @@ +
BOOST_FILESYSTEM_POSIX_API and BOOST_FILESYSTEM_WINDOWS_API. These macros may not necessarily match the old BOOST_POSIX_API and BOOST_WINDOWS_API macros defined by Boost.System.error_code argument on successful completion of the permissions operation. (PR#338) cout << "\nobservers, native format:" << endl;
-# ifdef BOOST_POSIX_API
+# ifdef BOOST_FILESYSTEM_POSIX_API
cout << " native()-------------: " << p.native() << endl;
cout << " c_str()--------------: " << p.c_str() << endl;
-# else // BOOST_WINDOWS_API
+# else // BOOST_FILESYSTEM_WINDOWS_API
wcout << L" native()-------------: " << p.native() << endl;
wcout << L" c_str()--------------: " << p.c_str() << endl;
# endif
diff --git a/example/path_info.cpp b/example/path_info.cpp
index 0f2ed67..75a075d 100644
--- a/example/path_info.cpp
+++ b/example/path_info.cpp
@@ -25,9 +25,9 @@ int main(int argc, char* argv[])
cout << "Usage: path_info path-element [path-element...]\n"
"Composes a path via operator/= from one or more path-element arguments\n"
"Example: path_info foo/bar baz\n"
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
" would report info about the composed path foo/bar/baz\n";
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
" would report info about the composed path foo/bar\\baz\n";
#endif
return 1;
@@ -46,10 +46,10 @@ int main(int argc, char* argv[])
cout << " " << element << '\n';
cout << "\nobservers, native format:" << endl;
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
cout << " native()-------------: " << p.native() << endl;
cout << " c_str()--------------: " << p.c_str() << endl;
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
wcout << L" native()-------------: " << p.native() << endl;
wcout << L" c_str()--------------: " << p.c_str() << endl;
#endif
diff --git a/include/boost/filesystem/config.hpp b/include/boost/filesystem/config.hpp
index 795a0fe..9e77453 100644
--- a/include/boost/filesystem/config.hpp
+++ b/include/boost/filesystem/config.hpp
@@ -17,7 +17,6 @@
// http://www.boost.org/more/separate_compilation.html
#include
-#include // for BOOST_POSIX_API or BOOST_WINDOWS_API
#include
#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 3 && BOOST_FILESYSTEM_VERSION != 4
@@ -54,6 +53,19 @@
#error Both BOOST_FILESYSTEM_DEPRECATED and BOOST_FILESYSTEM_NO_DEPRECATED are defined
#endif
+// BOOST_FILESYSTEM_WINDOWS_API or BOOST_FILESYSTEM_POSIX_API -------------------------//
+
+#if defined(BOOST_FILESYSTEM_WINDOWS_API) || defined(BOOST_FILESYSTEM_POSIX_API)
+#error BOOST_FILESYSTEM_WINDOWS_API and BOOST_FILESYSTEM_POSIX_API must not be defined by users
+#endif
+
+// Cygwin is treated as Windows to minimize path character code conversions
+#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
+#define BOOST_FILESYSTEM_WINDOWS_API
+#else
+#define BOOST_FILESYSTEM_POSIX_API
+#endif
+
// throw an exception ----------------------------------------------------------------//
//
// Exceptions were originally thrown via boost::throw_exception().
diff --git a/include/boost/filesystem/cstdio.hpp b/include/boost/filesystem/cstdio.hpp
index b09e89f..66be390 100644
--- a/include/boost/filesystem/cstdio.hpp
+++ b/include/boost/filesystem/cstdio.hpp
@@ -15,7 +15,7 @@
#include
#include
#include
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
#include
#include
#include
@@ -27,7 +27,7 @@
namespace boost {
namespace filesystem {
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
inline std::FILE* fopen(filesystem::path const& p, const char* mode)
{
@@ -70,14 +70,14 @@ inline std::FILE* fopen(filesystem::path const& p, const char* mode)
#endif
}
-#else // defined(BOOST_WINDOWS_API)
+#else // defined(BOOST_FILESYSTEM_WINDOWS_API)
inline std::FILE* fopen(filesystem::path const& p, const char* mode)
{
return std::fopen(p.c_str(), mode);
}
-#endif // defined(BOOST_WINDOWS_API)
+#endif // defined(BOOST_FILESYSTEM_WINDOWS_API)
} // namespace filesystem
} // namespace boost
diff --git a/include/boost/filesystem/detail/path_traits.hpp b/include/boost/filesystem/detail/path_traits.hpp
index 4cd81a2..d68afc0 100644
--- a/include/boost/filesystem/detail/path_traits.hpp
+++ b/include/boost/filesystem/detail/path_traits.hpp
@@ -55,7 +55,7 @@ class directory_entry;
namespace detail {
namespace path_traits {
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
typedef wchar_t path_native_char_type;
#define BOOST_FILESYSTEM_DETAIL_IS_CHAR_NATIVE false
#define BOOST_FILESYSTEM_DETAIL_IS_WCHAR_T_NATIVE true
diff --git a/include/boost/filesystem/directory.hpp b/include/boost/filesystem/directory.hpp
index ff02105..7b38354 100644
--- a/include/boost/filesystem/directory.hpp
+++ b/include/boost/filesystem/directory.hpp
@@ -632,7 +632,7 @@ namespace detail {
struct dir_itr_imp :
public boost::intrusive_ref_counter< dir_itr_imp >
{
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
bool close_handle;
unsigned char extra_data_format;
std::size_t current_offset;
@@ -641,7 +641,7 @@ struct dir_itr_imp :
void* handle;
dir_itr_imp() noexcept :
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
close_handle(false),
extra_data_format(0u),
current_offset(0u),
diff --git a/include/boost/filesystem/fstream.hpp b/include/boost/filesystem/fstream.hpp
index 452f764..d6f50e4 100644
--- a/include/boost/filesystem/fstream.hpp
+++ b/include/boost/filesystem/fstream.hpp
@@ -20,7 +20,7 @@
#include // must be the last #include
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
// On Windows, except for standard libaries known to have wchar_t overloads for
// file stream I/O, use path::string() to get a narrow character c_str()
#if (defined(_CPPLIB_VER) && _CPPLIB_VER >= 405 && !defined(_STLPORT_VERSION)) || \
@@ -40,7 +40,7 @@
// Use narrow characters, since wide not available
#define BOOST_FILESYSTEM_C_STR(p) p.string().c_str()
#endif
-#endif // defined(BOOST_WINDOWS_API)
+#endif // defined(BOOST_FILESYSTEM_WINDOWS_API)
#if !defined(BOOST_FILESYSTEM_C_STR)
#define BOOST_FILESYSTEM_C_STR(p) p.c_str()
diff --git a/include/boost/filesystem/operations.hpp b/include/boost/filesystem/operations.hpp
index 5cd40a3..3a48976 100644
--- a/include/boost/filesystem/operations.hpp
+++ b/include/boost/filesystem/operations.hpp
@@ -603,7 +603,7 @@ inline path temp_directory_path(system::error_code& ec)
}
inline path unique_path(path const& p =
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
L"%%%%-%%%%-%%%%-%%%%"
#else
"%%%%-%%%%-%%%%-%%%%"
@@ -617,7 +617,7 @@ inline path unique_path(system::error_code& ec)
{
return detail::unique_path
(
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
L"%%%%-%%%%-%%%%-%%%%",
#else
"%%%%-%%%%-%%%%-%%%%",
diff --git a/include/boost/filesystem/path.hpp b/include/boost/filesystem/path.hpp
index f6e38f4..a749ecc 100644
--- a/include/boost/filesystem/path.hpp
+++ b/include/boost/filesystem/path.hpp
@@ -108,7 +108,7 @@ struct path_algorithms
BOOST_FILESYSTEM_DECL static path generic_path_v3(path const& p);
BOOST_FILESYSTEM_DECL static path generic_path_v4(path const& p);
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
BOOST_FILESYSTEM_DECL static void make_preferred_v3(path& p);
BOOST_FILESYSTEM_DECL static void make_preferred_v4(path& p);
#endif
@@ -160,7 +160,7 @@ struct path_algorithms
class path :
public filesystem::path_detail::path_constants<
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
detail::path_traits::path_native_char_type, L'/', L'\\', L'.'
#else
detail::path_traits::path_native_char_type, '/', '/', '.'
@@ -865,7 +865,7 @@ public:
template< typename String >
String string(codecvt_type const& cvt) const;
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
std::string string() const
{
std::string tmp;
@@ -884,7 +884,7 @@ public:
// string_type is std::wstring, so there is no conversion
std::wstring const& wstring() const { return m_pathname; }
std::wstring const& wstring(codecvt_type const&) const { return m_pathname; }
-#else // BOOST_POSIX_API
+#else // BOOST_FILESYSTEM_POSIX_API
// string_type is std::string, so there is no conversion
std::string const& string() const { return m_pathname; }
std::string const& string(codecvt_type const&) const { return m_pathname; }
@@ -1012,7 +1012,7 @@ public:
bool is_relative() const { return !is_absolute(); }
bool is_absolute() const
{
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
return has_root_name() && has_root_directory();
#else
return has_root_directory();
@@ -1343,12 +1343,12 @@ inline typename std::enable_if<
std::size_t
>::type hash_value(Path const& p) noexcept
{
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
std::size_t seed = 0u;
for (typename Path::value_type const* it = p.c_str(); *it; ++it)
hash_combine(seed, *it == L'/' ? L'\\' : *it);
return seed;
-#else // BOOST_POSIX_API
+#else // BOOST_FILESYSTEM_POSIX_API
return hash_range(p.native().begin(), p.native().end());
#endif
}
@@ -1416,7 +1416,7 @@ namespace detail {
inline bool is_directory_separator(path::value_type c) noexcept
{
return c == path::separator
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
|| c == path::preferred_separator
#endif
;
@@ -1425,7 +1425,7 @@ inline bool is_directory_separator(path::value_type c) noexcept
inline bool is_element_separator(path::value_type c) noexcept
{
return c == path::separator
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
|| c == path::preferred_separator || c == L':'
#endif
;
@@ -1621,7 +1621,7 @@ BOOST_FORCEINLINE path path::generic_path() const
BOOST_FORCEINLINE path& path::make_preferred()
{
// No effect on POSIX
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
BOOST_FILESYSTEM_VERSIONED_SYM(detail::path_algorithms::make_preferred)(*this);
#endif
return *this;
diff --git a/src/directory.cpp b/src/directory.cpp
index be6903c..2a495a8 100644
--- a/src/directory.cpp
+++ b/src/directory.cpp
@@ -31,7 +31,7 @@
#include
#include
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
#include
#include
@@ -60,7 +60,7 @@
#include "posix_tools.hpp"
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
#include
#include
@@ -68,7 +68,7 @@
#include "windows_tools.hpp"
-#endif // BOOST_WINDOWS_API
+#endif // BOOST_FILESYSTEM_WINDOWS_API
#include "atomic_tools.hpp"
#include "error_handling.hpp"
@@ -115,7 +115,7 @@ BOOST_FILESYSTEM_DECL void directory_entry::refresh_impl(system::error_code* ec)
namespace detail {
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
//! Opens a directory file and returns a file descriptor. Returns a negative value in case of error.
boost::scope::unique_fd open_directory(path const& p, directory_options opts, system::error_code& ec)
@@ -211,7 +211,7 @@ boost::scope::unique_fd openat_directory(int basedir_fd, path const& p, director
#endif // defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
BOOST_CONSTEXPR_OR_CONST std::size_t dir_itr_imp_extra_data_alignment = 16u;
@@ -246,7 +246,7 @@ inline void* get_dir_itr_imp_extra_data(dir_itr_imp* imp) noexcept
return reinterpret_cast< unsigned char* >(imp) + extra_data_offset;
}
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
inline system::error_code dir_itr_close(dir_itr_imp& imp) noexcept
{
@@ -523,7 +523,7 @@ system::error_code dir_itr_create(boost::intrusive_ptr< detail::dir_itr_imp >& i
BOOST_CONSTEXPR_OR_CONST err_t not_found_error_code = ENOENT;
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
inline void set_file_statuses(DWORD attrs, const ULONG* reparse_point_tag, fs::path const& filename, fs::file_status& sf, fs::file_status& symlink_sf)
{
@@ -1083,11 +1083,11 @@ done:
BOOST_CONSTEXPR_OR_CONST err_t not_found_error_code = ERROR_PATH_NOT_FOUND;
-#endif // BOOST_WINDOWS_API
+#endif // BOOST_FILESYSTEM_WINDOWS_API
} // namespace
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
//! Tests if the directory is empty
bool is_empty_directory(boost::scope::unique_fd&& fd, path const& p, error_code* ec)
@@ -1165,7 +1165,7 @@ bool is_empty_directory(boost::scope::unique_fd&& fd, path const& p, error_code*
#endif // !defined(BOOST_FILESYSTEM_USE_READDIR_R)
}
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
//! Tests if the directory is empty
bool is_empty_directory(unique_handle&& h, path const& p, error_code* ec)
@@ -1187,7 +1187,7 @@ void init_directory_iterator_impl() noexcept
}
}
-#endif // defined(BOOST_WINDOWS_API)
+#endif // defined(BOOST_FILESYSTEM_WINDOWS_API)
BOOST_FILESYSTEM_DECL
dir_itr_imp::~dir_itr_imp() noexcept
@@ -1475,10 +1475,10 @@ void recursive_directory_iterator_increment(recursive_directory_iterator& it, sy
file_type symlink_ft = status_error;
-#if defined(BOOST_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
+#if defined(BOOST_FILESYSTEM_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
int parentdir_fd = -1;
path dir_it_filename;
-#elif defined(BOOST_WINDOWS_API)
+#elif defined(BOOST_FILESYSTEM_WINDOWS_API)
unique_handle direntry_handle;
#endif
@@ -1487,7 +1487,7 @@ void recursive_directory_iterator_increment(recursive_directory_iterator& it, sy
if ((imp->m_options & directory_options::follow_directory_symlink) == directory_options::none ||
(imp->m_options & directory_options::skip_dangling_symlinks) != directory_options::none)
{
-#if defined(BOOST_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
+#if defined(BOOST_FILESYSTEM_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
directory_iterator const& dir_it = imp->m_stack.back();
if (filesystem::type_present(dir_it->m_symlink_status))
{
@@ -1505,7 +1505,7 @@ void recursive_directory_iterator_increment(recursive_directory_iterator& it, sy
if (ec)
return result;
}
-#elif defined(BOOST_WINDOWS_API)
+#elif defined(BOOST_FILESYSTEM_WINDOWS_API)
directory_iterator const& dir_it = imp->m_stack.back();
if (filesystem::type_present(dir_it->m_symlink_status))
{
@@ -1568,7 +1568,7 @@ void recursive_directory_iterator_increment(recursive_directory_iterator& it, sy
if (ft != status_error && ft != directory_file)
return result;
-#if defined(BOOST_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
+#if defined(BOOST_FILESYSTEM_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
if (parentdir_fd < 0)
{
parentdir_fd = dir_itr_fd(*dir_it.m_imp, ec);
@@ -1598,8 +1598,8 @@ void recursive_directory_iterator_increment(recursive_directory_iterator& it, sy
return result;
}
-#else // defined(BOOST_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
-#if defined(BOOST_WINDOWS_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
if (!!direntry_handle && symlink_ft == symlink_file)
{
// Close the symlink to reopen the target file below
@@ -1638,10 +1638,10 @@ void recursive_directory_iterator_increment(recursive_directory_iterator& it, sy
get_file_type_by_handle:
ft = detail::status_by_handle(direntry_handle.get(), dir_it->path(), &ec).type();
}
-#else // defined(BOOST_WINDOWS_API)
+#else // defined(BOOST_FILESYSTEM_WINDOWS_API)
if (ft == status_error)
ft = dir_it->file_type(ec);
-#endif // defined(BOOST_WINDOWS_API)
+#endif // defined(BOOST_FILESYSTEM_WINDOWS_API)
if (BOOST_UNLIKELY(!!ec))
{
@@ -1657,7 +1657,7 @@ void recursive_directory_iterator_increment(recursive_directory_iterator& it, sy
if (ft != directory_file)
return result;
-#endif // defined(BOOST_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
if (BOOST_UNLIKELY((imp->m_stack.size() - 1u) >= static_cast< std::size_t >((std::numeric_limits< int >::max)())))
{
@@ -1669,10 +1669,10 @@ void recursive_directory_iterator_increment(recursive_directory_iterator& it, sy
return result;
}
-#if defined(BOOST_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
+#if defined(BOOST_FILESYSTEM_POSIX_API) && defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW) && defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
directory_iterator next;
detail::directory_iterator_construct(next, dir_it->path(), imp->m_options, ¶ms, &ec);
-#elif defined(BOOST_WINDOWS_API)
+#elif defined(BOOST_FILESYSTEM_WINDOWS_API)
detail::directory_iterator_params params;
params.dir_handle = direntry_handle.get();
params.close_handle = true;
@@ -1683,7 +1683,7 @@ void recursive_directory_iterator_increment(recursive_directory_iterator& it, sy
#endif
if (BOOST_LIKELY(!ec))
{
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
direntry_handle.release();
#endif
if (!next.is_end())
diff --git a/src/error_handling.hpp b/src/error_handling.hpp
index a335756..7bd9920 100644
--- a/src/error_handling.hpp
+++ b/src/error_handling.hpp
@@ -18,7 +18,7 @@
#include
#include
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
#include
#include
#include
@@ -29,7 +29,7 @@
namespace boost {
namespace filesystem {
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
typedef int err_t;
diff --git a/src/operations.cpp b/src/operations.cpp
index c5ad4af..7af1ce3 100644
--- a/src/operations.cpp
+++ b/src/operations.cpp
@@ -41,7 +41,7 @@
#define BOOST_FILESYSTEM_USE_WASI
#endif
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
#include
#include
@@ -145,7 +145,7 @@
#include "posix_tools.hpp"
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
#include // get_proc_address, GetModuleHandleW
#include
@@ -163,7 +163,7 @@ using std::time_t;
#include "windows_tools.hpp"
-#endif // BOOST_WINDOWS_API
+#endif // BOOST_FILESYSTEM_WINDOWS_API
#include "atomic_tools.hpp"
#include "error_handling.hpp"
@@ -178,7 +178,7 @@ using boost::filesystem::perms;
using boost::system::error_code;
using boost::system::system_category;
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
// At least Mac OS X 10.6 and older doesn't support O_CLOEXEC
#ifndef O_CLOEXEC
@@ -190,7 +190,7 @@ using boost::system::system_category;
#define BOOST_FILESYSTEM_HAS_FDATASYNC
#endif
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
#ifndef MAXIMUM_REPARSE_DATA_BUFFER_SIZE
#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE (16 * 1024)
@@ -213,7 +213,7 @@ using boost::system::system_category;
#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE 0x2
#endif
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
// POSIX/Windows macros ----------------------------------------------------//
@@ -224,13 +224,13 @@ using boost::system::system_category;
// order of arguments, and meaning of return were followed initially, but
// found to be less clear and cause more coding errors.]
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
#define BOOST_SET_CURRENT_DIRECTORY(P) (::chdir(P) == 0)
#define BOOST_MOVE_FILE(OLD, NEW) (::rename(OLD, NEW) == 0)
#define BOOST_RESIZE_FILE(P, SZ) (::truncate(P, SZ) == 0)
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
#define BOOST_SET_CURRENT_DIRECTORY(P) (::SetCurrentDirectoryW(P) != 0)
#define BOOST_MOVE_FILE(OLD, NEW) (::MoveFileExW(OLD, NEW, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED) != 0)
@@ -247,10 +247,10 @@ namespace detail {
void init_fill_random_impl(unsigned int major_ver, unsigned int minor_ver, unsigned int patch_ver);
#endif // defined(linux) || defined(__linux) || defined(__linux__)
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
//! Initializes directory iterator implementation. Implemented in directory.cpp.
void init_directory_iterator_impl() noexcept;
-#endif // defined(BOOST_WINDOWS_API)
+#endif // defined(BOOST_FILESYSTEM_WINDOWS_API)
namespace {
@@ -266,7 +266,7 @@ BOOST_CONSTEXPR_OR_CONST unsigned int remove_all_directory_replaced_retry_count
// Size of a small buffer for a path that can be placed on stack, in character code units
BOOST_CONSTEXPR_OR_CONST std::size_t small_path_size = 1024u;
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
//--------------------------------------------------------------------------------------//
// //
@@ -1236,7 +1236,7 @@ uintmax_t remove_all_impl
return static_cast< uintmax_t >(-1);
}
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
//--------------------------------------------------------------------------------------//
// //
@@ -2419,7 +2419,7 @@ done:
return win32_path;
}
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
} // unnamed namespace
@@ -2435,7 +2435,7 @@ namespace detail {
BOOST_FILESYSTEM_DECL bool possible_large_file_size_support()
{
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
typedef struct stat struct_stat;
return sizeof(struct_stat().st_size) > 4;
#else
@@ -2563,7 +2563,7 @@ namespace {
inline path canonical_common(path& source, system::error_code* ec)
{
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
system::error_code local_ec;
file_status st(detail::status_impl(source, &local_ec));
@@ -2677,7 +2677,7 @@ inline path canonical_common(path& source, system::error_code* ec)
BOOST_ASSERT_MSG(result.is_absolute(), "canonical() implementation error; please report");
return result;
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
unique_handle h(create_file_handle(
source.c_str(),
@@ -2779,7 +2779,7 @@ inline path canonical_common(path& source, system::error_code* ec)
BOOST_ASSERT_MSG(result.is_absolute(), "canonical() implementation error; please report");
return result;
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
}
} // unnamed namespace
@@ -3006,7 +3006,7 @@ bool copy_file(path const& from, path const& to, copy_options options, error_cod
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
int err = 0;
@@ -3223,7 +3223,7 @@ bool copy_file(path const& from, path const& to, copy_options options, error_cod
return true;
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
DWORD copy_flags = 0u;
if ((options & copy_options::overwrite_existing) == copy_options::none ||
@@ -3348,7 +3348,7 @@ bool copy_file(path const& from, path const& to, copy_options options, error_cod
return true;
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
}
BOOST_FILESYSTEM_DECL
@@ -3436,7 +3436,7 @@ bool create_directory(path const& p, const path* existing, error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
mode_t mode = S_IRWXU | S_IRWXG | S_IRWXO;
if (existing)
@@ -3476,7 +3476,7 @@ bool create_directory(path const& p, const path* existing, error_code* ec)
if (::mkdir(p.c_str(), mode) == 0)
return true;
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
BOOL res;
if (existing)
@@ -3487,7 +3487,7 @@ bool create_directory(path const& p, const path* existing, error_code* ec)
if (res)
return true;
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
// attempt to create directory failed
err_t errval = BOOST_ERRNO; // save reason for failure
@@ -3507,7 +3507,7 @@ void create_directory_symlink(path const& to, path const& from, system::error_co
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
int err = ::symlink(to.c_str(), from.c_str());
if (BOOST_UNLIKELY(err < 0))
{
@@ -3535,7 +3535,7 @@ void create_hard_link(path const& to, path const& from, error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
int err = ::link(to.c_str(), from.c_str());
if (BOOST_UNLIKELY(err < 0))
{
@@ -3564,7 +3564,7 @@ void create_symlink(path const& to, path const& from, error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
int err = ::symlink(to.c_str(), from.c_str());
if (BOOST_UNLIKELY(err < 0))
{
@@ -3595,7 +3595,7 @@ path current_path(error_code* ec)
// WASI also does not support current path.
emit_error(BOOST_ERROR_NOT_SUPPORTED, ec, "boost::filesystem::current_path");
return path();
-#elif defined(BOOST_POSIX_API)
+#elif defined(BOOST_FILESYSTEM_POSIX_API)
struct local
{
static bool getcwd_error(error_code* ec)
@@ -3673,7 +3673,7 @@ bool equivalent_v3(path const& p1, path const& p2, system::error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
// p2 is done first, so any error reported is for p1
#if defined(BOOST_FILESYSTEM_USE_STATX)
@@ -3785,7 +3785,7 @@ bool equivalent_v4(path const& p1, path const& p2, system::error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
#if defined(BOOST_FILESYSTEM_USE_STATX)
struct ::statx s1;
@@ -3897,7 +3897,7 @@ uintmax_t file_size(path const& p, error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
#if defined(BOOST_FILESYSTEM_USE_STATX)
struct ::statx path_stat;
@@ -3935,7 +3935,7 @@ uintmax_t file_size(path const& p, error_code* ec)
return get_size(path_stat);
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
// assume uintmax_t is 64-bits on all Windows compilers
@@ -3969,7 +3969,7 @@ uintmax_t file_size(path const& p, error_code* ec)
return (static_cast< uintmax_t >(info.nFileSizeHigh) << 32u) | info.nFileSizeLow;
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
}
BOOST_FILESYSTEM_DECL
@@ -3978,7 +3978,7 @@ uintmax_t hard_link_count(path const& p, system::error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
#if defined(BOOST_FILESYSTEM_USE_STATX)
struct ::statx path_stat;
@@ -4006,7 +4006,7 @@ uintmax_t hard_link_count(path const& p, system::error_code* ec)
return static_cast< uintmax_t >(path_stat.st_nlink);
#endif
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
unique_handle h(create_file_handle(
p.c_str(),
@@ -4030,7 +4030,7 @@ uintmax_t hard_link_count(path const& p, system::error_code* ec)
return static_cast< uintmax_t >(info.nNumberOfLinks);
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
}
BOOST_FILESYSTEM_DECL
@@ -4047,7 +4047,7 @@ path initial_path(error_code* ec)
//! Tests if the directory is empty. Implemented in directory.cpp.
bool is_empty_directory
(
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
boost::scope::unique_fd&& fd,
#else
unique_handle&& h,
@@ -4062,7 +4062,7 @@ bool is_empty(path const& p, system::error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
boost::scope::unique_fd file;
int err = 0;
@@ -4125,7 +4125,7 @@ bool is_empty(path const& p, system::error_code* ec)
return get_size(path_stat) == 0u;
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
unique_handle h(create_file_handle(
p.c_str(),
@@ -4152,7 +4152,7 @@ bool is_empty(path const& p, system::error_code* ec)
return (info.nFileSizeHigh | info.nFileSizeLow) == 0u;
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
}
BOOST_FILESYSTEM_DECL
@@ -4161,7 +4161,7 @@ std::time_t creation_time(path const& p, system::error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
#if defined(BOOST_FILESYSTEM_USE_STATX)
struct ::statx stx;
@@ -4189,7 +4189,7 @@ std::time_t creation_time(path const& p, system::error_code* ec)
return (std::numeric_limits< std::time_t >::min)();
#endif
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
// See the comment in last_write_time regarding access rights used here for GetFileTime.
unique_handle hw(create_file_handle(
@@ -4221,7 +4221,7 @@ std::time_t creation_time(path const& p, system::error_code* ec)
return t;
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
}
BOOST_FILESYSTEM_DECL
@@ -4230,7 +4230,7 @@ std::time_t last_write_time(path const& p, system::error_code* ec)
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
#if defined(BOOST_FILESYSTEM_USE_STATX)
struct ::statx stx;
@@ -4255,7 +4255,7 @@ std::time_t last_write_time(path const& p, system::error_code* ec)
return st.st_mtime;
#endif
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
// GetFileTime is documented to require GENERIC_READ access right, but this causes problems if the file
// is opened by another process without FILE_SHARE_READ. In practice, FILE_READ_ATTRIBUTES works, and
@@ -4289,7 +4289,7 @@ std::time_t last_write_time(path const& p, system::error_code* ec)
return t;
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
}
BOOST_FILESYSTEM_DECL
@@ -4298,7 +4298,7 @@ void last_write_time(path const& p, const std::time_t new_time, system::error_co
if (ec)
ec->clear();
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
#if defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
@@ -4332,7 +4332,7 @@ void last_write_time(path const& p, const std::time_t new_time, system::error_co
#endif // defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
unique_handle hw(create_file_handle(
p.c_str(),
@@ -4360,10 +4360,10 @@ void last_write_time(path const& p, const std::time_t new_time, system::error_co
if (BOOST_UNLIKELY(!::SetFileTime(hw.get(), nullptr, nullptr, &lwt)))
goto fail_errno;
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
}
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
const perms active_bits(all_all | set_uid_on_exe | set_gid_on_exe | sticky_bit);
inline mode_t mode_cast(perms prms)
{
@@ -4384,7 +4384,7 @@ void permissions(path const& p, perms prms, system::error_code* ec)
#if defined(BOOST_FILESYSTEM_USE_WASI)
emit_error(BOOST_ERROR_NOT_SUPPORTED, p, ec, "boost::filesystem::permissions");
-#elif defined(BOOST_POSIX_API)
+#elif defined(BOOST_FILESYSTEM_POSIX_API)
error_code local_ec;
file_status current_status((prms & symlink_perms) ? detail::symlink_status_impl(p, &local_ec) : detail::status_impl(p, &local_ec));
if (local_ec)
@@ -4466,7 +4466,7 @@ path read_symlink(path const& p, system::error_code* ec)
path symlink_path;
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
const char* const path_str = p.c_str();
char small_buf[small_path_size];
ssize_t result = ::readlink(path_str, small_buf, sizeof(small_buf));
@@ -4621,7 +4621,7 @@ void rename(path const& old_p, path const& new_p, error_code* ec)
BOOST_FILESYSTEM_DECL
void resize_file(path const& p, uintmax_t size, system::error_code* ec)
{
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
if (BOOST_UNLIKELY(size > static_cast< uintmax_t >((std::numeric_limits< off_t >::max)())))
{
emit_error(system::errc::file_too_large, p, ec, "boost::filesystem::resize_file");
@@ -4647,7 +4647,7 @@ space_info space(path const& p, error_code* ec)
emit_error(BOOST_ERROR_NOT_SUPPORTED, p, ec, "boost::filesystem::space");
-#elif defined(BOOST_POSIX_API)
+#elif defined(BOOST_FILESYSTEM_POSIX_API)
struct BOOST_STATVFS vfs;
if (!error(::BOOST_STATVFS(p.c_str(), &vfs) ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::space"))
@@ -4741,7 +4741,7 @@ path temp_directory_path(system::error_code* ec)
if (ec)
ec->clear();
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
const char* val = nullptr;
@@ -4821,7 +4821,7 @@ path temp_directory_path(system::error_code* ec)
BOOST_FILESYSTEM_DECL
path system_complete(path const& p, system::error_code* ec)
{
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
if (p.empty() || p.is_absolute())
return p;
@@ -4870,7 +4870,7 @@ path weakly_canonical_v3(path const& p, path const& base, system::error_code* ec
system::error_code local_ec;
const path::iterator source_end(source.end());
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
path::iterator itr(source_end);
path head(source);
@@ -5035,7 +5035,7 @@ path weakly_canonical_v4(path const& p, path const& base, system::error_code* ec
system::error_code local_ec;
const path::iterator source_end(source.end());
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
path::iterator itr(source_end);
path head(source);
diff --git a/src/path.cpp b/src/path.cpp
index 2ce3c4c..43e79a3 100644
--- a/src/path.cpp
+++ b/src/path.cpp
@@ -24,7 +24,7 @@
#include
#include // std::atexit
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
#include "windows_file_codecvt.hpp"
#include "windows_tools.hpp"
#include
@@ -61,7 +61,7 @@ typedef path::value_type value_type;
typedef path::string_type string_type;
typedef string_type::size_type size_type;
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
const wchar_t dot_path_literal[] = L".";
const wchar_t dot_dot_path_literal[] = L"..";
@@ -103,7 +103,7 @@ inline size_type find_separator(const wchar_t* p, size_type size) noexcept
return pos;
}
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
const char dot_path_literal[] = ".";
const char dot_dot_path_literal[] = "..";
@@ -119,7 +119,7 @@ inline size_type find_separator(const char* p, size_type size) noexcept
return pos;
}
-#endif // BOOST_WINDOWS_API
+#endif // BOOST_FILESYSTEM_WINDOWS_API
// pos is position of the separator
bool is_root_separator(string_type const& str, size_type root_dir_pos, size_type pos);
@@ -181,7 +181,7 @@ BOOST_FILESYSTEM_DECL path path_algorithms::lexically_normal_v3(path const& p)
size_type root_dir_pos = find_root_directory_start(pathname, pathname_size, root_name_size);
path normal(pathname, pathname + root_name_size);
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
for (size_type i = 0; i < root_name_size; ++i)
{
if (normal.m_pathname[i] == path::separator)
@@ -380,7 +380,7 @@ BOOST_FILESYSTEM_DECL path path_algorithms::generic_path_v3(path const& p)
if (root_name_size > 0u)
{
tmp.m_pathname.append(pathname, root_name_size);
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
std::replace(tmp.m_pathname.begin(), tmp.m_pathname.end(), L'\\', L'/');
#endif
}
@@ -454,7 +454,7 @@ BOOST_FILESYSTEM_DECL path path_algorithms::generic_path_v4(path const& p)
return tmp;
}
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
// make_preferred -------------------------------------------------------------------//
@@ -478,7 +478,7 @@ BOOST_FILESYSTEM_DECL void path_algorithms::make_preferred_v4(path& p)
}
}
-#endif // defined(BOOST_WINDOWS_API)
+#endif // defined(BOOST_FILESYSTEM_WINDOWS_API)
// append --------------------------------------------------------------------------//
@@ -514,7 +514,7 @@ BOOST_FILESYSTEM_DECL void path_algorithms::append_v4(path& p, const value_type*
// if (p.is_absolute())
if
(
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
that_root_name_size > 0 &&
#endif
that_root_dir_pos < that_size
@@ -621,7 +621,7 @@ BOOST_FILESYSTEM_DECL path_algorithms::string_type::size_type path_algorithms::a
{
string_type::size_type size(p.m_pathname.size());
if (size > static_cast< string_type::size_type >(0) &&
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
p.m_pathname[size - 1] != colon &&
#endif
!detail::is_directory_separator(p.m_pathname[size - 1]))
@@ -639,7 +639,7 @@ BOOST_FILESYSTEM_DECL void path_algorithms::erase_redundant_separator(path& p, s
if (sep_pos // a separator was added
&& sep_pos < p.m_pathname.size() // and something was appended
&& (p.m_pathname[sep_pos + 1] == path::separator // and it was also separator
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
|| p.m_pathname[sep_pos + 1] == path::preferred_separator // or preferred_separator
#endif
))
@@ -1008,7 +1008,7 @@ size_type find_root_directory_start(const value_type* path, size_type size, size
root_name_size = 2;
return 2;
}
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
// cases "\\?\" and "\\.\"
else if (size >= 4 && (path[2] == questionmark || path[2] == fs::path::dot) && fs::detail::is_directory_separator(path[3]))
@@ -1030,7 +1030,7 @@ size_type find_root_directory_start(const value_type* path, size_type size, size
goto find_next_separator;
}
}
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
// https://stackoverflow.com/questions/23041983/path-prefixes-and
// case "\??\" (NT path prefix)
else if (size >= 4 && path[1] == questionmark && path[2] == questionmark && fs::detail::is_directory_separator(path[3]))
@@ -1046,7 +1046,7 @@ size_type find_root_directory_start(const value_type* path, size_type size, size
}
}
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
// case "c:" or "prn:"
// Note: There is ambiguity in a "c:x" path interpretation. It could either mean a file "x" located at the current directory for drive C:,
// or an alternative stream "x" of a file "c". Windows API resolve this as the former, and so do we.
@@ -1380,7 +1380,7 @@ BOOST_FILESYSTEM_DECL path::iterator path::begin() const
if (element_size > 0)
{
itr.m_element = m_pathname.substr(itr.m_pos, element_size);
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
if (itr.m_element.m_pathname.size() == 1u && itr.m_element.m_pathname[0] == path::preferred_separator)
itr.m_element.m_pathname[0] = path::separator;
#endif
@@ -1424,7 +1424,7 @@ namespace {
std::locale default_locale()
{
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
std::locale global_loc = std::locale();
return std::locale(global_loc, new boost::filesystem::detail::windows_file_codecvt());
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__)
diff --git a/src/posix_tools.hpp b/src/posix_tools.hpp
index 09af4d5..e857bcd 100644
--- a/src/posix_tools.hpp
+++ b/src/posix_tools.hpp
@@ -57,7 +57,7 @@ file_status symlink_status_impl
#endif
);
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
//! Opens a directory file and returns a file descriptor. Returns a negative value in case of error.
boost::scope::unique_fd open_directory(path const& p, directory_options opts, system::error_code& ec);
@@ -67,7 +67,7 @@ boost::scope::unique_fd open_directory(path const& p, directory_options opts, sy
boost::scope::unique_fd openat_directory(int basedir_fd, path const& p, directory_options opts, system::error_code& ec);
#endif // defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
} // namespace detail
} // namespace filesystem
diff --git a/src/unique_path.cpp b/src/unique_path.cpp
index e98677f..b2e0704 100644
--- a/src/unique_path.cpp
+++ b/src/unique_path.cpp
@@ -16,7 +16,7 @@
#include
#include
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
#include
#include
@@ -57,7 +57,7 @@
#include
#include "posix_tools.hpp"
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
// We use auto-linking below to help users of static builds of Boost.Filesystem to link to whatever Windows SDK library we selected.
// The dependency information is currently not exposed in CMake config files generated by Boost.Build (https://github.com/boostorg/boost_install/issues/18),
@@ -85,7 +85,7 @@
#endif // !defined(BOOST_FILESYSTEM_NO_DEPRECATED) && defined(_MSC_VER)
#endif // defined(BOOST_FILESYSTEM_HAS_BCRYPT)
-#endif // BOOST_POSIX_API
+#endif // BOOST_FILESYSTEM_POSIX_API
#include
#include
@@ -96,12 +96,12 @@
#include // must be the last #include
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
// At least Mac OS X 10.6 and older doesn't support O_CLOEXEC
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
namespace boost {
namespace filesystem {
@@ -109,7 +109,7 @@ namespace detail {
namespace {
-#if defined(BOOST_POSIX_API) && !defined(BOOST_FILESYSTEM_HAS_ARC4RANDOM)
+#if defined(BOOST_FILESYSTEM_POSIX_API) && !defined(BOOST_FILESYSTEM_HAS_ARC4RANDOM)
//! Fills buffer with cryptographically random data obtained from /dev/(u)random
int fill_random_dev_random(void* buf, std::size_t len)
@@ -205,11 +205,11 @@ int fill_random_getrandom(void* buf, std::size_t len)
#endif // defined(BOOST_FILESYSTEM_HAS_GETRANDOM) || defined(BOOST_FILESYSTEM_HAS_GETRANDOM_SYSCALL)
-#endif // defined(BOOST_POSIX_API) && !defined(BOOST_FILESYSTEM_HAS_ARC4RANDOM)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API) && !defined(BOOST_FILESYSTEM_HAS_ARC4RANDOM)
void system_crypt_random(void* buf, std::size_t len, boost::system::error_code* ec)
{
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
#if defined(BOOST_FILESYSTEM_HAS_GETRANDOM) || defined(BOOST_FILESYSTEM_HAS_GETRANDOM_SYSCALL)
@@ -229,7 +229,7 @@ void system_crypt_random(void* buf, std::size_t len, boost::system::error_code*
#endif
-#else // defined(BOOST_POSIX_API)
+#else // defined(BOOST_FILESYSTEM_POSIX_API)
#if defined(BOOST_FILESYSTEM_HAS_BCRYPT)
@@ -274,10 +274,10 @@ void system_crypt_random(void* buf, std::size_t len, boost::system::error_code*
#endif // defined(BOOST_FILESYSTEM_HAS_BCRYPT)
-#endif // defined(BOOST_POSIX_API)
+#endif // defined(BOOST_FILESYSTEM_POSIX_API)
}
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
BOOST_CONSTEXPR_OR_CONST wchar_t hex[] = L"0123456789abcdef";
BOOST_CONSTEXPR_OR_CONST wchar_t percent = L'%';
#else
diff --git a/src/windows_file_codecvt.cpp b/src/windows_file_codecvt.cpp
index f86ba51..1746489 100644
--- a/src/windows_file_codecvt.cpp
+++ b/src/windows_file_codecvt.cpp
@@ -13,7 +13,7 @@
#include // for mbstate_t
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
#include "windows_file_codecvt.hpp"
@@ -69,4 +69,4 @@ std::codecvt_base::result windows_file_codecvt::do_out(
#include
-#endif // BOOST_WINDOWS_API
+#endif // BOOST_FILESYSTEM_WINDOWS_API
diff --git a/src/windows_file_codecvt.hpp b/src/windows_file_codecvt.hpp
index e0f0ae6..3620647 100644
--- a/src/windows_file_codecvt.hpp
+++ b/src/windows_file_codecvt.hpp
@@ -12,7 +12,7 @@
#include
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
#include
#include
@@ -67,6 +67,6 @@ protected:
#include
-#endif // BOOST_WINDOWS_API
+#endif // BOOST_FILESYSTEM_WINDOWS_API
#endif // BOOST_FILESYSTEM_WINDOWS_FILE_CODECVT_HPP
diff --git a/test/config_info.cpp b/test/config_info.cpp
index aa36774..58c4ac4 100644
--- a/test/config_info.cpp
+++ b/test/config_info.cpp
@@ -34,8 +34,8 @@ int main()
cout << " BOOST_ALL_NO_LIB: " << BOOST_MACRO_VALUE(BOOST_ALL_NO_LIB) << endl;
cout << " BOOST_FILESYSTEM_NO_LIB: " << BOOST_MACRO_VALUE(BOOST_FILESYSTEM_NO_LIB) << endl;
cout << " BOOST_LIB_NAME: " << BOOST_MACRO_VALUE(BOOST_LIB_NAME) << endl;
- cout << " BOOST_POSIX_API: " << BOOST_MACRO_VALUE(BOOST_POSIX_API) << endl;
- cout << " BOOST_WINDOWS_API: " << BOOST_MACRO_VALUE(BOOST_WINDOWS_API) << endl;
+ cout << " BOOST_FILESYSTEM_POSIX_API: " << BOOST_MACRO_VALUE(BOOST_FILESYSTEM_POSIX_API) << endl;
+ cout << " BOOST_FILESYSTEM_WINDOWS_API: " << BOOST_MACRO_VALUE(BOOST_FILESYSTEM_WINDOWS_API) << endl;
cout << " _MSC_VER: " << BOOST_MACRO_VALUE(_MSC_VER) << endl;
cout << " __MINGW32__: " << BOOST_MACRO_VALUE(__MINGW32__) << endl;
//cout << " : " << BOOST_MACRO_VALUE() << endl;
diff --git a/test/convenience_test.cpp b/test/convenience_test.cpp
index 484c93c..246c47e 100644
--- a/test/convenience_test.cpp
+++ b/test/convenience_test.cpp
@@ -105,7 +105,7 @@ int cpp_main(int, char*[])
fs::remove(unique_dir / "uu");
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
// These tests depends on ordering of directory entries, and that's guaranteed
// on Windows but not necessarily on other operating systems
{
diff --git a/test/issues/recurse_dir_iter_5403.cpp b/test/issues/recurse_dir_iter_5403.cpp
index ef6d0f4..85223b1 100644
--- a/test/issues/recurse_dir_iter_5403.cpp
+++ b/test/issues/recurse_dir_iter_5403.cpp
@@ -50,11 +50,11 @@ bool skip_long_windows_tests = false;
int cpp_main(int argc, char* argv[])
{
// document state of critical macros
-#ifdef BOOST_POSIX_API
- cout << "BOOST_POSIX_API is defined\n";
+#ifdef BOOST_FILESYSTEM_POSIX_API
+ cout << "BOOST_FILESYSTEM_POSIX_API is defined\n";
#endif
-#ifdef BOOST_WINDOWS_API
- cout << "BOOST_WINDOWS_API is defined\n";
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
+ cout << "BOOST_FILESYSTEM_WINDOWS_API is defined\n";
#endif
for (; argc > 1; --argc, ++argv)
@@ -70,12 +70,12 @@ int cpp_main(int argc, char* argv[])
// The choice of platform to test is made at runtime rather than compile-time
// so that compile errors for all platforms will be detected even though
// only the current platform is runtime tested.
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
platform = "POSIX";
-#elif defined(BOOST_WINDOWS_API)
+#elif defined(BOOST_FILESYSTEM_WINDOWS_API)
platform = "Windows";
#else
-#error neither BOOST_POSIX_API nor BOOST_WINDOWS_API is defined. See boost/system/api_config.hpp
+#error neither BOOST_FILESYSTEM_POSIX_API nor BOOST_FILESYSTEM_WINDOWS_API is defined. See boost/system/api_config.hpp
#endif
cout << "API is " << platform << endl;
cout << "initial_path() is " << fs::initial_path() << endl;
diff --git a/test/operations_test.cpp b/test/operations_test.cpp
index e3aa921..38748c4 100644
--- a/test/operations_test.cpp
+++ b/test/operations_test.cpp
@@ -47,11 +47,11 @@ using std::endl;
#include // for strncmp, etc.
#include
#include // for system(), getenv(), etc.
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
#include
#endif
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
#include
inline std::wstring convert(const char* c)
@@ -1121,7 +1121,7 @@ void predicate_and_status_tests()
BOOST_TEST(!fs::is_other(stat));
BOOST_TEST(!fs::is_symlink(stat));
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
stat = fs::status(L"\\System Volume Information");
BOOST_TEST(fs::type_present(stat));
BOOST_TEST(fs::permissions_present(stat));
@@ -1131,7 +1131,7 @@ void predicate_and_status_tests()
BOOST_TEST(!fs::is_regular_file(stat));
BOOST_TEST(!fs::is_other(stat));
BOOST_TEST(!fs::is_symlink(stat));
-#endif // BOOST_WINDOWS_API
+#endif // BOOST_FILESYSTEM_WINDOWS_API
}
// create_directory_tests ----------------------------------------------------------//
@@ -1144,7 +1144,7 @@ void create_directory_tests()
BOOST_TEST(!fs::create_directory("", ec));
BOOST_TEST(ec);
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
ec.clear();
BOOST_TEST(!fs::create_directory(" ", ec)); // OK on Linux
BOOST_TEST(ec);
@@ -1242,7 +1242,7 @@ void create_directories_tests()
BOOST_TEST(!fs::create_directories("", ec));
BOOST_TEST(ec);
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
// Windows only test, since " " is OK on Linux as a directory name
ec.clear();
BOOST_TEST(!fs::create_directories(" ", ec));
@@ -1261,7 +1261,7 @@ void create_directories_tests()
BOOST_TEST(!fs::create_directories("..", ec));
BOOST_TEST(!ec);
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_FILESYSTEM_POSIX_API
if (access("/", W_OK) != 0)
{
ec.clear();
@@ -1425,7 +1425,7 @@ void remove_tests(const fs::path& dirx)
BOOST_TEST(!fs::remove("no-such-file"));
BOOST_TEST(!fs::remove("no-such-directory/no-such-file"));
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
// remove() read-only file
BOOST_TEST(!fs::exists(f1x));
create_file(f1x, "");
@@ -1434,7 +1434,7 @@ void remove_tests(const fs::path& dirx)
set_read_only(f1x);
BOOST_TEST(fs::remove(f1x));
BOOST_TEST(!fs::exists(f1x));
-#endif // defined(BOOST_WINDOWS_API)
+#endif // defined(BOOST_FILESYSTEM_WINDOWS_API)
// remove() directory
fs::path d1x = dirx / "shortlife_dir";
@@ -1556,7 +1556,7 @@ void remove_all_tests(const fs::path& dirx)
BOOST_TEST(fs::exists(f1x));
BOOST_TEST(!fs::is_directory(f1x));
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
// read-only file
fs::path f2x = d1x / "shortlife_ro";
BOOST_TEST(!fs::exists(f2x));
@@ -1565,7 +1565,7 @@ void remove_all_tests(const fs::path& dirx)
BOOST_TEST(fs::exists(f2x));
BOOST_TEST(!fs::is_directory(f2x));
set_read_only(f2x);
-#endif // defined(BOOST_WINDOWS_API)
+#endif // defined(BOOST_FILESYSTEM_WINDOWS_API)
boost::uintmax_t removed_count = fs::remove_all(d1x);
BOOST_TEST_EQ(removed_count, created_count);
@@ -1682,7 +1682,7 @@ void absolute_tests()
BOOST_TEST_EQ(fs::absolute("bar", "foo"), fs::current_path() / "foo" / "bar");
BOOST_TEST_EQ(fs::absolute("/foo"), fs::current_path().root_path().string() + "foo");
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
BOOST_TEST_EQ(fs::absolute("a:foo", "b:/bar"), fs::path(L"a:/bar/foo"));
#endif
@@ -1739,7 +1739,7 @@ void absolute_tests()
}
// !p.has_root_name()
// p.has_root_directory()
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
BOOST_TEST_EQ(fs::absolute(fs::path("/"), "//xyz/"), fs::path("//xyz/"));
BOOST_TEST_EQ(fs::absolute(fs::path("/"), "//xyz/abc"), fs::path("//xyz/"));
BOOST_TEST_EQ(fs::absolute(fs::path("/foo"), "//xyz/"), fs::path("//xyz/foo"));
@@ -1821,7 +1821,7 @@ void canonical_basic_tests()
fs::path root(init.root_path());
fs::path::const_iterator it(init.begin());
fs::path first; // relative first non-root directory
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
if (!init.empty())
++it;
#endif
@@ -1842,7 +1842,7 @@ void canonical_basic_tests()
// ticket 9683 test
BOOST_TEST_EQ(fs::canonical(root / first / "../../../../.."), root);
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
// Test Windows long paths
fs::path long_path = make_long_path(dir / L"f0");
BOOST_TEST_EQ(fs::canonical(long_path), long_path);
@@ -1957,7 +1957,7 @@ void copy_file_tests(const fs::path& f1x, const fs::path& d1x)
fs::remove(d1x / "f2-non-existing");
// Sleep for a while so that the last modify time is more recent for new files
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
sleep(2);
#else
Sleep(2000);
@@ -2064,7 +2064,7 @@ void copy_file_tests(const fs::path& f1x, const fs::path& d1x)
BOOST_TEST_GT(fs::file_size(d1x / "cmdline"), 0u);
}
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
// Test copying files with multiple NTFS streams
fs::path multi_stream_path = d1x / "multi-stream";
fs::path multi_stream_alt_path = d1x / "multi-stream:alt-stream";
@@ -2131,7 +2131,7 @@ void copy_file_tests(const fs::path& f1x, const fs::path& d1x)
{
cout << "Multiple streams per file are not supported: " << e.what() << "\nSkipping multi-stream tests..." << endl;
}
-#endif // BOOST_WINDOWS_API
+#endif // BOOST_FILESYSTEM_WINDOWS_API
}
// symlink_status_tests -------------------------------------------------------------//
@@ -2174,7 +2174,7 @@ void symlink_status_tests()
BOOST_TEST_EQ(fs::status(sym_f1, ec).type(), fs::regular_file);
BOOST_TEST_EQ(fs::status(symsym_f1, ec).type(), fs::regular_file);
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
// On Windows, telling if a filesystem entry is a symlink (or junction which is
// treated as a symlink), rather than some other kind of reparse point, requires some
@@ -2264,7 +2264,7 @@ void creation_time_tests(const fs::path& dirx)
// These pauses are inserted because the test spuriously fails on Windows, presumably because of
// different converting FILETIME to seconds in time() and Boost.Filesystem or some sort of quirk
// in the Windows implementation of filesystem API.
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
sleep(1);
#else
Sleep(1000);
@@ -2274,7 +2274,7 @@ void creation_time_tests(const fs::path& dirx)
try
{
std::time_t ft = fs::creation_time(f1x);
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
sleep(1);
#else
Sleep(1000);
@@ -2680,7 +2680,7 @@ void temp_directory_path_tests()
cout << "temp_directory_path_tests..." << endl;
cout << " temp_directory_path() is " << fs::temp_directory_path() << endl;
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
//**************************************************************************************//
// Bug in GCC 4.9 getenv() when !defined(__GXX_EXPERIMENTAL_CXX0X__) makes these
@@ -2745,7 +2745,7 @@ void temp_directory_path_tests()
fs::path test_temp_dir = temp_dir;
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
{
struct guarded_tmp_vars
{
@@ -2783,7 +2783,7 @@ void temp_directory_path_tests()
}
#endif
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
struct guarded_tmp_vars
{
@@ -2858,7 +2858,7 @@ void weakly_canonical_basic_tests()
BOOST_TEST_EQ(fs::weakly_canonical("../foo", d1), dir / "foo");
BOOST_TEST_EQ(fs::weakly_canonical("..//foo", d1), dir / "foo");
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
BOOST_TEST_EQ(fs::weakly_canonical("c:/no-such/foo/bar"), fs::path("C:/no-such/foo/bar"));
// Test Windows long paths
@@ -2901,11 +2901,11 @@ void weakly_canonical_symlink_tests()
int cpp_main(int argc, char* argv[])
{
// document state of critical macros
-#ifdef BOOST_POSIX_API
- cout << "BOOST_POSIX_API is defined\n";
+#ifdef BOOST_FILESYSTEM_POSIX_API
+ cout << "BOOST_FILESYSTEM_POSIX_API is defined\n";
#endif
-#ifdef BOOST_WINDOWS_API
- cout << "BOOST_WINDOWS_API is defined\n";
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
+ cout << "BOOST_FILESYSTEM_WINDOWS_API is defined\n";
#endif
for (; argc > 1; --argc, ++argv)
@@ -2921,12 +2921,12 @@ int cpp_main(int argc, char* argv[])
// The choice of platform to test is made at runtime rather than compile-time
// so that compile errors for all platforms will be detected even though
// only the current platform is runtime tested.
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_FILESYSTEM_POSIX_API)
platform = "POSIX";
-#elif defined(BOOST_WINDOWS_API)
+#elif defined(BOOST_FILESYSTEM_WINDOWS_API)
platform = "Windows";
#else
-#error neither BOOST_POSIX_API nor BOOST_WINDOWS_API is defined. See boost/system/api_config.hpp
+#error neither BOOST_FILESYSTEM_POSIX_API nor BOOST_FILESYSTEM_WINDOWS_API is defined. See boost/system/api_config.hpp
#endif
cout << "API is " << platform << endl;
const fs::path ip = fs::initial_path();
diff --git a/test/operations_unit_test.cpp b/test/operations_unit_test.cpp
index e5c3c62..8cd5b0a 100644
--- a/test/operations_unit_test.cpp
+++ b/test/operations_unit_test.cpp
@@ -343,11 +343,11 @@ void error_handling_test()
int cpp_main(int argc, char* argv[])
{
// document state of critical macros
-#ifdef BOOST_POSIX_API
- cout << "BOOST_POSIX_API is defined\n";
+#ifdef BOOST_FILESYSTEM_POSIX_API
+ cout << "BOOST_FILESYSTEM_POSIX_API is defined\n";
#endif
-#ifdef BOOST_WINDOWS_API
- cout << "BOOST_WINDOWS_API is defined\n";
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
+ cout << "BOOST_FILESYSTEM_WINDOWS_API is defined\n";
#endif
cout << "BOOST_FILESYSTEM_DECL" << BOOST_STRINGIZE(=BOOST_FILESYSTEM_DECL) << "\n";
cout << "BOOST_SYMBOL_VISIBLE" << BOOST_STRINGIZE(=BOOST_SYMBOL_VISIBLE) << "\n";
diff --git a/test/path_test.cpp b/test/path_test.cpp
index c51009b..195e122 100644
--- a/test/path_test.cpp
+++ b/test/path_test.cpp
@@ -72,7 +72,7 @@ using boost::filesystem::path;
using boost::next;
using boost::prior;
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
#define BOOST_DIR_SEP "\\"
#else
#define BOOST_DIR_SEP "/"
@@ -163,7 +163,7 @@ public:
operator fs::path() const { return m_path; }
operator const fs::path::value_type*() const
{
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_FILESYSTEM_WINDOWS_API)
return L"[invalid path]";
#else
return "[invalid path]";
diff --git a/test/path_unit_test.cpp b/test/path_unit_test.cpp
index 31680c0..d26e333 100644
--- a/test/path_unit_test.cpp
+++ b/test/path_unit_test.cpp
@@ -85,7 +85,7 @@ void check_path(const path& source, const wstring& expected, const char* file, i
<< L"\"\n";
}
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
void check_native(const path& p, const string&, const wstring& expected, const char* file, int line)
#else
void check_native(const path& p, const string& expected, const wstring&, const char* file, int line)
@@ -301,7 +301,7 @@ void test_appends()
{
std::cout << "testing appends..." << std::endl;
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
#define BOOST_FS_FOO L"/foo\\"
#else // POSIX paths
#define BOOST_FS_FOO L"/foo/"
@@ -468,7 +468,7 @@ void test_observers()
CHECK(p0.native().size() == 0);
CHECK(p0.size() == 0);
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
path p("abc\\def/ghi");
@@ -485,7 +485,7 @@ void test_observers()
CHECK(p.generic_string< wstring >() == L"abc/def/ghi");
CHECK(p.generic_string< path::string_type >() == L"abc/def/ghi");
-#else // BOOST_POSIX_API
+#else // BOOST_FILESYSTEM_POSIX_API
path p("abc\\def/ghi");
@@ -513,7 +513,7 @@ void test_relationals()
boost::hash< path > hash;
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
// this is a critical use case to meet user expectations
CHECK(path("c:\\abc") == path("c:/abc"));
CHECK(hash(path("c:\\abc")) == hash(path("c:/abc")));
@@ -645,7 +645,7 @@ void test_other_non_members()
CHECK(path("/").filename() == path(""));
#endif
CHECK(!path("/").filename_is_dot());
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
CHECK(path("c:.").filename() == path("."));
CHECK(path("c:.").filename_is_dot());
#if BOOST_FILESYSTEM_VERSION == 3
@@ -654,7 +654,7 @@ void test_other_non_members()
CHECK(path("c:/").filename() == path(""));
#endif
CHECK(!path("c:\\").filename_is_dot());
-#else // BOOST_WINDOWS_API
+#else // BOOST_FILESYSTEM_WINDOWS_API
CHECK(path("c:.").filename() == path("c:."));
CHECK(!path("c:.").filename_is_dot());
#if BOOST_FILESYSTEM_VERSION == 3
@@ -664,7 +664,7 @@ void test_other_non_members()
CHECK(path("c:/").filename() == path(""));
CHECK(!path("c:/").filename_is_dot());
#endif
-#endif // BOOST_WINDOWS_API
+#endif // BOOST_FILESYSTEM_WINDOWS_API
// check that the implementation code to make the edge cases above work right
// doesn't cause some non-edge cases to fail
@@ -813,7 +813,7 @@ void test_decompositions()
CHECK(path("//netname").root_path().string() == "//netname");
CHECK(path("//netname/foo").root_path().string() == "//netname/");
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
CHECK(path("c:/foo").root_path().string() == "c:/");
#endif
@@ -1060,7 +1060,7 @@ void test_error_handling()
// These tests rely on a path constructor that fails in the locale conversion.
// Thus construction has to call codecvt. Force that by using a narrow string
// for Windows, and a wide string for POSIX.
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
#define STRING_FOO_ "foo"
#else
#define STRING_FOO_ L"foo"
@@ -1159,12 +1159,12 @@ inline const char* macro_value(const char* name, const char* value)
int test_main(int, char*[])
{
// document state of critical macros
-#ifdef BOOST_POSIX_API
- cout << "BOOST_POSIX_API" << endl;
+#ifdef BOOST_FILESYSTEM_POSIX_API
+ cout << "BOOST_FILESYSTEM_POSIX_API" << endl;
BOOST_TEST(path::preferred_separator == '/');
#endif
-#ifdef BOOST_WINDOWS_API
- cout << "BOOST_WINDOWS_API" << endl;
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
+ cout << "BOOST_FILESYSTEM_WINDOWS_API" << endl;
BOOST_TEST(path::preferred_separator == '\\');
#endif
diff --git a/test/relative_test.cpp b/test/relative_test.cpp
index e2d7b13..fe0173a 100644
--- a/test/relative_test.cpp
+++ b/test/relative_test.cpp
@@ -76,7 +76,7 @@ void lexically_relative_test()
// Some tests from Jamie Allsop's paper
BOOST_TEST(path("/a/d").lexically_relative("/a/b/c") == "../../d");
BOOST_TEST(path("/a/b/c").lexically_relative("/a/d") == "../b/c");
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
BOOST_TEST(path("c:\\y").lexically_relative("c:\\x") == "../y");
#else
BOOST_TEST(path("c:\\y").lexically_relative("c:\\x") == "");
@@ -105,11 +105,11 @@ void lexically_proximate_test()
int test_main(int, char*[])
{
// document state of critical macros
-#ifdef BOOST_POSIX_API
- cout << "BOOST_POSIX_API" << endl;
+#ifdef BOOST_FILESYSTEM_POSIX_API
+ cout << "BOOST_FILESYSTEM_POSIX_API" << endl;
#endif
-#ifdef BOOST_WINDOWS_API
- cout << "BOOST_WINDOWS_API" << endl;
+#ifdef BOOST_FILESYSTEM_WINDOWS_API
+ cout << "BOOST_FILESYSTEM_WINDOWS_API" << endl;
#endif
lexically_relative_test();