summaryrefslogtreecommitdiff
path: root/ftp/libfilezilla/files/extra-patch-lib_libfilezilla_string.hpp
diff options
context:
space:
mode:
authorMartin Neubauer <m.ne@gmx.net>2024-12-30 09:52:13 +0100
committerKurt Jaeger <pi@FreeBSD.org>2024-12-30 09:58:43 +0100
commit24d0fe9dc3b17ae496c4733e34efabad71bedcce (patch)
tree82da57df44ab2b574bc413ca9bf9724f0859d8a9 /ftp/libfilezilla/files/extra-patch-lib_libfilezilla_string.hpp
parentgames/sulis: Fix area elevation in act3 areas (diff)
ftp/{lib}filezilla: update libfilezilla 0.47.0 -> 0.49.0, filezilla 3.67.0 -> 3.68.1
- Changed Downloads to LOCAL/pi because of new download obfuscation upstream PR: 283371, 283373, 283374 Author: Martin Neubauer <m.ne@gmx.net> Date: Mon Dec 30 09:52:13 2024 +0100 Changes: https://lib.filezilla-project.org/ https://filezilla-project.org/versions.php#3.68.1 Reported-by: andy@neu.net, rhurlin
Diffstat (limited to 'ftp/libfilezilla/files/extra-patch-lib_libfilezilla_string.hpp')
-rw-r--r--ftp/libfilezilla/files/extra-patch-lib_libfilezilla_string.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/ftp/libfilezilla/files/extra-patch-lib_libfilezilla_string.hpp b/ftp/libfilezilla/files/extra-patch-lib_libfilezilla_string.hpp
new file mode 100644
index 000000000000..87880be3e807
--- /dev/null
+++ b/ftp/libfilezilla/files/extra-patch-lib_libfilezilla_string.hpp
@@ -0,0 +1,42 @@
+--- lib/libfilezilla/string.hpp.orig 2024-10-15 12:59:21 UTC
++++ lib/libfilezilla/string.hpp
+@@ -11,6 +11,39 @@
+ #include <string_view>
+ #include <vector>
+
++template<class CharT, class BaseT>
++class traits_cloner
++{
++public:
++ using char_type = CharT;
++
++ using base_type = BaseT;
++ using base_traits = std::char_traits<base_type>;
++
++ static std::size_t length(char_type const* s) {
++ return base_traits::length(reinterpret_cast<base_type const*>(s));
++ }
++ static int compare(char_type const* s1, char_type const* s2, std::size_t count) {
++ return base_traits::compare(reinterpret_cast<base_type const*>(s1), reinterpret_cast<base_type const*>(s2), count);
++ }
++ static char_type* copy(char_type* dest, char_type const* src, std::size_t count) {
++ return reinterpret_cast<char_type*>(base_traits::copy(reinterpret_cast<base_type*>(dest), reinterpret_cast<base_type const*>(src), count));
++ }
++ static void assign( char_type& c1, char_type const& c2 ) noexcept {
++ c1 = c2;
++ }
++ static char_type const* find(char_type const* ptr, std::size_t count, char_type const& ch) {
++ return reinterpret_cast<char_type const*>(base_traits::find(reinterpret_cast<base_type const*>(ptr), count, reinterpret_cast<base_type const&>(ch)));
++ }
++ static bool eq(char_type a, char_type b) {
++ return base_traits::eq(static_cast<base_type>(a), static_cast<base_type>(b));
++ }
++};
++
++template<>
++class std::char_traits<uint8_t> : public traits_cloner<uint8_t, char>
++{};
++
+ /** \file
+ * \brief String types and assorted functions.
+ *