mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
util: Revert back MoveFileExW call for MinGW-w64
This commit is contained in:
parent
25a91a571a
commit
d4999d40b9
@ -1062,9 +1062,20 @@ void ArgsManager::LogArgs() const
|
||||
|
||||
bool RenameOver(fs::path src, fs::path dest)
|
||||
{
|
||||
#ifdef __MINGW64__
|
||||
// This is a workaround for a bug in libstdc++ which
|
||||
// implements std::filesystem::rename with _wrename function.
|
||||
// This bug has been fixed in upstream:
|
||||
// - GCC 10.3: 8dd1c1085587c9f8a21bb5e588dfe1e8cdbba79e
|
||||
// - GCC 11.1: 1dfd95f0a0ca1d9e6cbc00e6cbfd1fa20a98f312
|
||||
// For more details see the commits mentioned above.
|
||||
return MoveFileExW(src.wstring().c_str(), dest.wstring().c_str(),
|
||||
MOVEFILE_REPLACE_EXISTING) != 0;
|
||||
#else
|
||||
std::error_code error;
|
||||
fs::rename(src, dest, error);
|
||||
return !error;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user