[Buildroot] [PATCH 1/1] package/qpdf: fix build without wchar

Fabrice Fontaine fontaine.fabrice at gmail.com
Sat Feb 29 13:01:30 UTC 2020


Fixes:
 - http://autobuild.buildroot.org/results/99c82d4775ed44bd04d0a48188ff590dcba73d69

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
---
 ...pdf-QUtil.cc-fix-build-without-wchar.patch | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 package/qpdf/0002-libqpdf-QUtil.cc-fix-build-without-wchar.patch

diff --git a/package/qpdf/0002-libqpdf-QUtil.cc-fix-build-without-wchar.patch b/package/qpdf/0002-libqpdf-QUtil.cc-fix-build-without-wchar.patch
new file mode 100644
index 0000000000..32d61562a5
--- /dev/null
+++ b/package/qpdf/0002-libqpdf-QUtil.cc-fix-build-without-wchar.patch
@@ -0,0 +1,44 @@
+From 852fc293245ab5b85be5e45a4f034d65c0635aeb Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+Date: Sat, 29 Feb 2020 13:42:15 +0100
+Subject: [PATCH] libqpdf/QUtil.cc: fix build without wchar
+
+Build on Linux toolchains without wchar fails since version 9.1.1 and
+a44b5a34a07b9f2905d419d5571fd53832c1f6c0 on:
+
+libqpdf/QUtil.cc: In function 'int QUtil::call_main_from_wmain(int, wchar_t**, std::function<int(int, char**)>)':
+libqpdf/QUtil.cc:2378:32: error: 'wcslen' was not declared in this scope
+         for (size_t j = 0; j < wcslen(argv[i]); ++j)
+                                ^~~~~~
+
+To fix this error, return -1 if WINDOWS_WMAIN is not defined
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+[Upstream status: https://github.com/qpdf/qpdf/pull/405]
+---
+ libqpdf/QUtil.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc
+index 1d29bcc..1c4ff2d 100644
+--- a/libqpdf/QUtil.cc
++++ b/libqpdf/QUtil.cc
+@@ -2366,6 +2366,7 @@ QUtil::possible_repaired_encodings(std::string supplied)
+ int
+ QUtil::call_main_from_wmain(int argc, wchar_t* argv[], std::function<int(int, char*[])> realmain)
+ {
++#ifdef WINDOWS_WMAIN
+     // argv contains UTF-16-encoded strings with a 16-bit wchar_t.
+     // Convert this to UTF-8-encoded strings for compatibility with
+     // other systems. That way the rest of qpdf.cc can just act like
+@@ -2396,4 +2397,7 @@ QUtil::call_main_from_wmain(int argc, wchar_t* argv[], std::function<int(int, ch
+     argc = QIntC::to_int(utf8_argv.size());
+     new_argv[argc] = 0;
+     return realmain(argc, new_argv);
++#else
++    return -1;
++#endif
+ }
+-- 
+2.25.0
+
-- 
2.25.0



More information about the buildroot mailing list