summaryrefslogtreecommitdiff
path: root/freefilesync/revert_zenju_aggressive_upstreamisms.patch
diff options
context:
space:
mode:
Diffstat (limited to 'freefilesync/revert_zenju_aggressive_upstreamisms.patch')
-rw-r--r--freefilesync/revert_zenju_aggressive_upstreamisms.patch95
1 files changed, 74 insertions, 21 deletions
diff --git a/freefilesync/revert_zenju_aggressive_upstreamisms.patch b/freefilesync/revert_zenju_aggressive_upstreamisms.patch
index 6cae409..de8d5e9 100644
--- a/freefilesync/revert_zenju_aggressive_upstreamisms.patch
+++ b/freefilesync/revert_zenju_aggressive_upstreamisms.patch
@@ -1,3 +1,6 @@
+Message: Some of these can be traced back to version 10.23 which was the last to not use <unordered_map>
+Date: 2021-05-10
+Version: 11.10
diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/wx+/choice_enum.h
--- 10.24-0/wx+/choice_enum.h 2020-05-17 18:30:59.441499418 -0400
+++ 10.24-1/wx+/choice_enum.h 2020-05-17 18:53:59.893685507 -0400
@@ -9,37 +12,32 @@ diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/
#include <vector>
#include <wx/choice.h>
-@@ -44,11 +43,8 @@
- descrList.push_back({value, {text, tooltip}});
- return *this;
- }
--
+@@ -47,8 +46,6 @@
+
using DescrList = std::vector<std::pair<Enum, std::pair<wxString, wxString>>>;
DescrList descrList;
-
-- std::unordered_map<const wxChoice*, std::vector<wxString>> itemsSetLast;
+- std::unordered_map<const wxChoice*, std::vector<wxString>> labelsSetLast;
};
template <class Enum> void setEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value);
template <class Enum> Enum getEnumVal(const EnumDescrList<Enum>& mapping, const wxChoice& ctrl);
-@@ -69,34 +65,26 @@
-
- //--------------- impelementation -------------------------------------------
+@@ -71,32 +68,24 @@
template <class Enum>
--void setEnumVal(EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value)
-+void setEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value)
+ void setEnumVal(EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value)
{
-- auto& itemsSetLast = mapping.itemsSetLast[&ctrl];
+- auto& labelsSetLast = mapping.labelsSetLast[&ctrl];
+-
+- std::vector<wxString> labels;
+- for (const auto& [val, texts] : mapping.descrList)
+- labels.push_back(texts.first);
+ ctrl.Clear();
-- std::vector<wxString> items;
+- if (labels != labelsSetLast)
+ int selectedPos = 0;
- for (auto it = mapping.descrList.begin(); it != mapping.descrList.end(); ++it)
-- items.push_back(it->second.first);
--
-- if (items != itemsSetLast)
++ for (auto it = mapping.descrList.begin(); it != mapping.descrList.end(); ++it)
{
-- ctrl.Set(items); //expensive as fuck! => only call when absolutely needed!
-- itemsSetLast = std::move(items);
+- ctrl.Set(labels); //expensive as fuck! => only call when absolutely needed!
+- labelsSetLast = std::move(labels);
+ ctrl.Append(it->second.first);
+ if (it->first == value)
+ {
@@ -52,7 +50,7 @@ diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/
+ }
}
- //-----------------------------------------------------------------
--
+
- const auto it = std::find_if(mapping.descrList.begin(), mapping.descrList.end(), [&](const auto& mapItem) { return mapItem.first == value; });
- if (it != mapping.descrList.end())
- {
@@ -61,7 +59,7 @@ diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/
- ctrl.SetToolTip(tooltip);
- else
- ctrl.UnsetToolTip();
-
+-
- const int selectedPos = it - mapping.descrList.begin();
- ctrl.SetSelection(selectedPos);
- }
@@ -305,3 +303,58 @@ diff -Naur -x '*.orig' -x '*.rej' -x '*.git*' 11.4-1/wx+/no_flicker.h 11.4-2/wx+
//get rid of margins and space between text blocks/"paragraphs"
richCtrl.SetMargins({0, 0});
+Message: Revert __cpp_lib_atomic_wait which is not yet implemented in g++-10 or clang++-11 on Debian
+How does Zenju compile this?!
+Date: 2021-05-10
+--- 11.9-0/zen/globals.h 2021-05-10 08:10:14.755776667 -0400
++++ 11.9-1/zen/globals.h 2021-05-10 09:17:25.122241641 -0400
+@@ -223,7 +223,11 @@
+ void PodSpinMutex::lock()
+ {
+ while (!tryLock())
++#ifdef __cpp_lib_atomic_wait
+ flag_.wait(true, std::memory_order_relaxed);
++#else
++ ;
++#endif
+ }
+
+
+@@ -231,7 +235,9 @@
+ void PodSpinMutex::unlock()
+ {
+ flag_.clear(std::memory_order_release);
++#ifdef __cpp_lib_atomic_wait
+ flag_.notify_one();
++#endif
+ }
+
+
+Message: This one should work; it's a c++17 specification, but it doesn't work.
+Date: 2021-05-10
+diff -aur 11.10-0/zen/legacy_compiler.cpp 11.10-1/zen/legacy_compiler.cpp
+--- 11.10-0/zen/legacy_compiler.cpp 2021-05-10 08:10:14.755776667 -0400
++++ 11.10-1/zen/legacy_compiler.cpp 2021-05-10 10:06:01.998079701 -0400
+@@ -14,15 +14,17 @@
+
+ double zen::fromChars(const char* first, const char* last)
+ {
+- double num = 0;
+- [[maybe_unused]] const std::from_chars_result rv = std::from_chars(first, last, num);
+- return num;
++ return std::strtod(std::string(first, last).c_str(), nullptr);
+ }
+
+
+ const char* zen::toChars(char* first, char* last, double num)
+ {
+- const std::to_chars_result rv = std::to_chars(first, last, num);
+- return rv.ec == std::errc{} ? rv.ptr : first;
++ const size_t bufSize = last - first;
++ const int charsWritten = std::snprintf(first, bufSize, "%g", num);
++ //C99: returns number of chars written if successful, < 0 or >= bufferSize on failure
++
++ return 0 <= charsWritten && charsWritten < static_cast<int>(bufSize) ?
++ first + charsWritten : first;
+ }
+
bgstack15