mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-01-31 02:20:53 +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.
This commit is contained in:
parent
37909dd1b9
commit
95554c3e5c
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user