mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-01-31 10:30:52 +00:00
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. Cherry-picked from: 95554c3e Github Pull Request: #3558 Conflicts resolved: - boost fs prefix added in src/wallet/wallet.cpp
This commit is contained in:
parent
b9a99f613f
commit
aa568d45d3
@ -4020,7 +4020,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
|
||||
boost::filesystem::copy_file(pathSrc, pathDest, boost::filesystem::copy_options::overwrite_existing);
|
||||
#elif BOOST_VERSION >= 104000
|
||||
boost::filesystem::copy_file(pathSrc, pathDest, boost::filesystem::copy_option::overwrite_if_exists);
|
||||
#else
|
||||
boost::filesystem::copy_file(pathSrc, pathDest);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user