summaryrefslogtreecommitdiff
path: root/freefilesync/ffs_no_gcc12.patch
blob: 666036d55b68b16580c1fc9e3073384ba6f83eca (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
64
65
66
67
68
69
70
71
72
73
74
Message: Because we do not use gcc 12, we have an error with unordered_map and std::pair.
Author: zensubz
Date-Modified: 2022-05-24
Version: 11.21
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;
--- a/zen/json.h
+++ b/zen/json.h
@@ -41,7 +41,7 @@
 
     Type type = Type::null;
     std::string                                primVal; //for primitive types
-    std::unordered_map<std::string, JsonValue> objectVal; //"[...] most implementations of JSON libraries do not accept duplicate keys [...]" => fine!
+    std::map<std::string, JsonValue> objectVal; //"[...] most implementations of JSON libraries do not accept duplicate keys [...]" => fine!
     std::vector<JsonValue>                     arrayVal;
 };
 
bgstack15