File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1062,9 +1062,20 @@ void ArgsManager::LogArgs() const
1062
1062
1063
1063
bool RenameOver (fs::path src, fs::path dest)
1064
1064
{
1065
+ #ifdef __MINGW64__
1066
+ // This is a workaround for a bug in libstdc++ which
1067
+ // implements std::filesystem::rename with _wrename function.
1068
+ // This bug has been fixed in upstream:
1069
+ // - GCC 10.3: 8dd1c1085587c9f8a21bb5e588dfe1e8cdbba79e
1070
+ // - GCC 11.1: 1dfd95f0a0ca1d9e6cbc00e6cbfd1fa20a98f312
1071
+ // For more details see the commits mentioned above.
1072
+ return MoveFileExW (src.wstring ().c_str (), dest.wstring ().c_str (),
1073
+ MOVEFILE_REPLACE_EXISTING) != 0 ;
1074
+ #else
1065
1075
std::error_code error;
1066
1076
fs::rename (src, dest, error);
1067
1077
return !error;
1078
+ #endif
1068
1079
}
1069
1080
1070
1081
/* *
You can’t perform that action at this time.
0 commit comments