external/liborcus/UnpackedTarball_liborcus.mk |    5 +++++
 external/liborcus/android-workaround.patch    |   22 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)

New commits:
commit c2673a358c78b864c1276f7956d5a348003b7a02
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Mon Sep 19 10:14:50 2016 +0200

    liborcus: fix Android build
    
    stoi() is missing in the std namespace on the broken Android toolchain,
    work it around.
    
    Change-Id: I9ea4f89bea346a4383fbb99e03b09ebae43d21e5

diff --git a/external/liborcus/UnpackedTarball_liborcus.mk 
b/external/liborcus/UnpackedTarball_liborcus.mk
index 08f3423..09b3c28 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -23,6 +23,11 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
        external/liborcus/windows-constants-hack.patch \
 ))
 endif
+ifeq ($(OS),ANDROID)
+$(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
+       external/liborcus/android-workaround.patch \
+))
+endif
 
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/liborcus/android-workaround.patch 
b/external/liborcus/android-workaround.patch
new file mode 100644
index 0000000..f9d047d
--- /dev/null
+++ b/external/liborcus/android-workaround.patch
@@ -0,0 +1,22 @@
+diff --git a/src/parser/sax_parser_base.cpp b/src/parser/sax_parser_base.cpp
+index 743130d..2624bd5 100644
+--- a/src/parser/sax_parser_base.cpp
++++ b/src/parser/sax_parser_base.cpp
+@@ -12,6 +12,17 @@
+ #include <vector>
+ #include <memory>
+ 
++#ifdef __ANDROID__
++namespace std
++{
++int stoi(const std::string& str, std::size_t* /*pos*/ = 0, int base = 10)
++{
++    char* end;
++    return strtol(str.c_str(), &end, base);
++}
++}
++#endif
++
+ namespace orcus { namespace sax {
+ 
+ malformed_xml_error::malformed_xml_error(const std::string& msg, 
std::ptrdiff_t offset) :
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to