From 95554c3e5c98dcff844013c3c9af9d06d2f7d8ed Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Wed, 12 Jun 2024 05:39:24 -0400 Subject: [PATCH] fs: for boost 1.74 and up, use c++17 compatible copy_options In boost 1.74.0, boost::filesystem adapted path::copy_option enum to be the same as the enum in the fs::path from c++17, which is now called copy_options, and its member "overwrite_if_exists" is now called "overwrite_existing". In boost 1.85, the deprecated copy_option enum is fully removed. Because Dogecoin Core currently supports boost 1.60 and up, conditionally implement the new enum based on the boost version that is built against. --- src/wallet/wallet.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d4373481f..524e44fa4 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4021,7 +4021,11 @@ bool CWallet::BackupWallet(const std::string& strDest) return false; } -#if BOOST_VERSION >= 104000 +#if BOOST_VERSION >= 107400 + // Boost 1.74.0 and up implements std++17 like "copy_options", and this + // is the only remaining enum after 1.85.0 + fs::copy_file(pathSrc, pathDest, fs::copy_options::overwrite_existing); +#elif BOOST_VERSION >= 104000 fs::copy_file(pathSrc, pathDest, fs::copy_option::overwrite_if_exists); #else fs::copy_file(pathSrc, pathDest);