mirror of
https://github.com/boostorg/filesystem.git
synced 2025-05-12 13:41:47 +00:00
Moved symloop_max constant into POSIX-specific section.
The constant is not used in the Windows-specific code and causes clang warnings. Closes https://github.com/boostorg/filesystem/pull/332.
This commit is contained in:
parent
30b312e5c0
commit
c7e1448803
@ -252,14 +252,14 @@ void init_fill_random_impl(unsigned int major_ver, unsigned int minor_ver, unsig
|
||||
void init_directory_iterator_impl() noexcept;
|
||||
#endif // defined(BOOST_WINDOWS_API)
|
||||
|
||||
namespace {
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// helpers (all operating systems) //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
namespace {
|
||||
|
||||
// The number of retries remove_all should make if it detects that the directory it is about to enter has been replaced with a symlink or a regular file
|
||||
BOOST_CONSTEXPR_OR_CONST unsigned int remove_all_directory_replaced_retry_count = 5u;
|
||||
|
||||
@ -268,6 +268,12 @@ BOOST_CONSTEXPR_OR_CONST std::size_t small_path_size = 1024u;
|
||||
|
||||
#if defined(BOOST_POSIX_API)
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// POSIX-specific helpers //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
// Absolute maximum path length, in character code units, that we're willing to accept from various system calls.
|
||||
// This value is arbitrary, it is supposed to be a hard limit to avoid memory exhaustion
|
||||
// in some of the algorithms below in case of some corrupted or maliciously broken filesystem.
|
||||
@ -278,8 +284,6 @@ BOOST_CONSTEXPR_OR_CONST std::size_t small_path_size = 1024u;
|
||||
// - GNU/Hurd: no hard limit
|
||||
BOOST_CONSTEXPR_OR_CONST std::size_t absolute_path_max = 32u * 1024u;
|
||||
|
||||
#endif // defined(BOOST_POSIX_API)
|
||||
|
||||
// Maximum number of resolved symlinks before we register a loop
|
||||
BOOST_CONSTEXPR_OR_CONST unsigned int symloop_max =
|
||||
#if defined(SYMLOOP_MAX)
|
||||
@ -289,16 +293,6 @@ BOOST_CONSTEXPR_OR_CONST unsigned int symloop_max =
|
||||
#endif
|
||||
;
|
||||
|
||||
// general helpers -----------------------------------------------------------------//
|
||||
|
||||
#ifdef BOOST_POSIX_API
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// POSIX-specific helpers //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
inline bool not_found_error(int errval) noexcept
|
||||
{
|
||||
return errval == ENOENT || errval == ENOTDIR;
|
||||
|
Loading…
x
Reference in New Issue
Block a user