View | Details | Raw Unified | Return to bug 282512
Collapse All | Expand All

(-)b/cad/kicad-devel/files/patch-eeschema_sch__io_easyedapro_sch__io__easyedapro.cpp (+34 lines)
Added Link Here
1
--- eeschema/sch_io/easyedapro/sch_io_easyedapro.cpp.orig	2024-10-11 09:03:05 UTC
2
+++ eeschema/sch_io/easyedapro/sch_io_easyedapro.cpp
3
@@ -105,6 +105,31 @@ int SCH_IO_EASYEDAPRO::GetModifyHash() const
4
 }
5
 
6
 
7
+// Explicitly define char traits for wxUniChar since it is not standard
8
+template<>
9
+struct nlohmann::detail::char_traits<wxUniChar> : std::char_traits<char32_t>
10
+{
11
+    using char_type = wxUniChar;
12
+    using int_type = uint32_t;
13
+
14
+    // Redefine to_int_type function
15
+    static int_type to_int_type(char_type c) noexcept
16
+    {
17
+        return static_cast<int_type>(c);
18
+    }
19
+
20
+    static char_type to_char_type(int_type i) noexcept
21
+    {
22
+        return static_cast<char_type>(i);
23
+    }
24
+
25
+    static constexpr int_type eof() noexcept
26
+    {
27
+        return ~0U;
28
+    }
29
+};
30
+
31
+
32
 static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryPath,
33
                                const wxString& aAliasName, const std::map<std::string, UTF8>* aProperties )
34
 {
(-)b/cad/kicad-devel/files/patch-thirdparty_compoundfilereader_compoundfilereader.h (+20 lines)
Added Link Here
1
--- thirdparty/compoundfilereader/compoundfilereader.h.orig	2024-10-11 09:03:05 UTC
2
+++ thirdparty/compoundfilereader/compoundfilereader.h
3
@@ -131,7 +131,7 @@ struct helper
4
     }
5
 };
6
 
7
-typedef std::basic_string<uint16_t> utf16string;
8
+typedef std::basic_string<char16_t> utf16string;
9
 typedef std::function<int(const COMPOUND_FILE_ENTRY*, const utf16string& dir, int level)>
10
     EnumFilesCallback;
11
 
12
@@ -249,7 +249,7 @@ class CompoundFileReader (private)
13
             utf16string newDir = dir;
14
             if (dir.length() != 0)
15
                 newDir.append(1, '\n');
16
-            newDir.append(entry->name, entry->nameLen / 2);
17
+            newDir.append(reinterpret_cast<const char16_t*>(entry->name), entry->nameLen / 2);
18
             EnumNodes(GetEntry(entry->childID), currentLevel + 1, maxLevel, newDir, callback);
19
         }
20
 
(-)b/cad/kicad-devel/files/patch-thirdparty_nanodbc_nanodbc_nanodbc.cpp (+44 lines)
Added Link Here
1
--- thirdparty/nanodbc/nanodbc/nanodbc.cpp.orig	2024-10-11 09:03:05 UTC
2
+++ thirdparty/nanodbc/nanodbc/nanodbc.cpp
3
@@ -255,10 +255,19 @@ constexpr std::size_t size(const T (&array)[N]) noexce
4
 }
5
 #endif
6
 
7
+inline std::size_t length(NANODBC_SQLCHAR const* s)
8
+{
9
+  std::size_t len = 0;
10
+  for (; *s != 0; ++s)
11
+    ++len;
12
+  return len;
13
+  
14
+}
15
+
16
 template <std::size_t N>
17
 inline std::size_t size(NANODBC_SQLCHAR const (&array)[N]) noexcept
18
 {
19
-    auto const n = std::char_traits<NANODBC_SQLCHAR>::length(array);
20
+    auto const n = length(array);
21
     NANODBC_ASSERT(n < N);
22
     return n < N ? n : N - 1;
23
 }
24
@@ -3589,9 +3598,9 @@ std::list<datasource> list_datasources()
25
                 "incompatible SQLCHAR and string::value_type");
26
 
27
             datasource dsn;
28
-            dsn.name = string(&name[0], &name[std::char_traits<NANODBC_SQLCHAR>::length(name)]);
29
+            dsn.name = string(&name[0], &name[length(name)]);
30
             dsn.driver =
31
-                string(&driver[0], &driver[std::char_traits<NANODBC_SQLCHAR>::length(driver)]);
32
+                string(&driver[0], &driver[length(driver)]);
33
 
34
             dsns.push_back(std::move(dsn));
35
             direction = SQL_FETCH_NEXT;
36
@@ -3642,7 +3651,7 @@ std::list<driver> list_drivers()
37
                 "incompatible SQLCHAR and string::value_type");
38
 
39
             driver drv;
40
-            drv.name = string(&descr[0], &descr[std::char_traits<NANODBC_SQLCHAR>::length(descr)]);
41
+            drv.name = string(&descr[0], &descr[length(descr)]);
42
 
43
             // Split "Key1=Value1\0Key2=Value2\0\0" into list of key-value pairs
44
             auto beg = &attrs[0];

Return to bug 282512