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

(-)b/cad/kicad/files/patch-thirdparty_compoundfilereader_compoundfilereader.h (+20 lines)
Added Link Here
1
--- thirdparty/compoundfilereader/compoundfilereader.h.orig	2023-04-13 20:27:39 UTC
2
+++ thirdparty/compoundfilereader/compoundfilereader.h
3
@@ -129,7 +129,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<void(const COMPOUND_FILE_ENTRY*, const utf16string& dir, int level)> 
10
     EnumFilesCallback;
11
 
12
@@ -246,7 +246,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/files/patch-thirdparty_nanodbc_nanodbc_nanodbc.cpp (+44 lines)
Added Link Here
1
--- thirdparty/nanodbc/nanodbc/nanodbc.cpp.orig	2023-04-13 20:27:39 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
@@ -3573,9 +3582,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
@@ -3626,7 +3635,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 281886