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
10621062
10631063bool RenameOver (fs::path src, fs::path dest)
10641064{
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
10651075 std::error_code error;
10661076 fs::rename (src, dest, error);
10671077 return !error;
1078+ #endif
10681079}
10691080
10701081/* *
You can’t perform that action at this time.
0 commit comments