Skip to content

Commit c7e1448

Browse files
committed
Moved symloop_max constant into POSIX-specific section.
The constant is not used in the Windows-specific code and causes clang warnings. Closes boostorg#332.
1 parent 30b312e commit c7e1448

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/operations.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,14 @@ void init_fill_random_impl(unsigned int major_ver, unsigned int minor_ver, unsig
252252
void init_directory_iterator_impl() noexcept;
253253
#endif // defined(BOOST_WINDOWS_API)
254254

255+
namespace {
256+
255257
//--------------------------------------------------------------------------------------//
256258
// //
257259
// helpers (all operating systems) //
258260
// //
259261
//--------------------------------------------------------------------------------------//
260262

261-
namespace {
262-
263263
// 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
264264
BOOST_CONSTEXPR_OR_CONST unsigned int remove_all_directory_replaced_retry_count = 5u;
265265

@@ -268,6 +268,12 @@ BOOST_CONSTEXPR_OR_CONST std::size_t small_path_size = 1024u;
268268

269269
#if defined(BOOST_POSIX_API)
270270

271+
//--------------------------------------------------------------------------------------//
272+
// //
273+
// POSIX-specific helpers //
274+
// //
275+
//--------------------------------------------------------------------------------------//
276+
271277
// Absolute maximum path length, in character code units, that we're willing to accept from various system calls.
272278
// This value is arbitrary, it is supposed to be a hard limit to avoid memory exhaustion
273279
// 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;
278284
// - GNU/Hurd: no hard limit
279285
BOOST_CONSTEXPR_OR_CONST std::size_t absolute_path_max = 32u * 1024u;
280286

281-
#endif // defined(BOOST_POSIX_API)
282-
283287
// Maximum number of resolved symlinks before we register a loop
284288
BOOST_CONSTEXPR_OR_CONST unsigned int symloop_max =
285289
#if defined(SYMLOOP_MAX)
@@ -289,16 +293,6 @@ BOOST_CONSTEXPR_OR_CONST unsigned int symloop_max =
289293
#endif
290294
;
291295

292-
// general helpers -----------------------------------------------------------------//
293-
294-
#ifdef BOOST_POSIX_API
295-
296-
//--------------------------------------------------------------------------------------//
297-
// //
298-
// POSIX-specific helpers //
299-
// //
300-
//--------------------------------------------------------------------------------------//
301-
302296
inline bool not_found_error(int errval) noexcept
303297
{
304298
return errval == ENOENT || errval == ENOTDIR;

0 commit comments

Comments
 (0)