summaryrefslogtreecommitdiff
path: root/freefilesync/ffs_no_gcc12.patch
blob: b25edaca8e5593c4e74fad06f4127df2d9e52edc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Message: Because we do not use gcc 12, we have an error with unordered_map and std::pair.
Author: zensubz
Date-Modified: 2022-06-27
Version: 11.22
Source: https://freefilesync.org/forum/viewtopic.php?t=9376&p=34044#p34044
Distro: any distro with g++ < 12
--- a/FreeFileSync/Source/base/db_file.cpp
+++ b/FreeFileSync/Source/base/db_file.cpp
@@ -642,7 +642,7 @@
 
     void process(const ContainerObject::FolderList& currentFolders, const Zstring& parentRelPath, InSyncFolder::FolderList& dbFolders)
     {
-        std::unordered_map<ZstringNorm, const FolderPair*> toPreserve;
+        std::map<ZstringNorm, const FolderPair*> toPreserve;
 
         for (const FolderPair& folder : currentFolders)
             if (!folder.isPairEmpty())
--- a/FreeFileSync/Source/base/db_file.h
+++ b/FreeFileSync/Source/base/db_file.h
@@ -67,9 +67,9 @@
     InSyncStatus status = DIR_STATUS_STRAW_MAN;
 
     //------------------------------------------------------------------
-    using FolderList  = std::unordered_map<ZstringNorm, InSyncFolder >; //
-    using FileList    = std::unordered_map<ZstringNorm, InSyncFile   >; // key: file name (ignoring Unicode normal forms)
-    using SymlinkList = std::unordered_map<ZstringNorm, InSyncSymlink>; //
+    using FolderList  = std::map<ZstringNorm, InSyncFolder >; //
+    using FileList    = std::map<ZstringNorm, InSyncFile   >; // key: file name (ignoring Unicode normal forms)
+    using SymlinkList = std::map<ZstringNorm, InSyncSymlink>; //
     //------------------------------------------------------------------
 
     FolderList  folders;
--- a/FreeFileSync/Source/base/file_hierarchy.h
+++ b/FreeFileSync/Source/base/file_hierarchy.h
@@ -7,12 +7,14 @@
 #ifndef FILE_HIERARCHY_H_257235289645296
 #define FILE_HIERARCHY_H_257235289645296
 
+#include <map>
 #include <string>
 #include <memory>
 #include <list>
 #include <functional>
 #include <unordered_set>
-#include <unordered_map>
+#include <zen/zstring.h>
+#include <zen/stl_tools.h>
 #include "structures.h"
 #include "path_filter.h"
 #include "../afs/abstract.h"
@@ -94,9 +96,9 @@
     //------------------------------------------------------------------
     //key: raw file name, without any (Unicode) normalization, preserving original upper-/lower-case
     //"Changing data [...] to NFC would cause interoperability problems. Always leave data as it is."
-    using FolderList  = std::unordered_map<Zstring, std::pair<FolderAttributes, FolderContainer>>;
-    using FileList    = std::unordered_map<Zstring, FileAttributes>;
-    using SymlinkList = std::unordered_map<Zstring, LinkAttributes>;
+    using FolderList  = std::map<Zstring, std::pair<FolderAttributes, FolderContainer>>;
+    using FileList    = std::map<Zstring, FileAttributes>;
+    using SymlinkList = std::map<Zstring, LinkAttributes>;
     //------------------------------------------------------------------
 
     FolderContainer() = default;
bgstack15