From 7fc9a220e0a5c7072324aa6b13b31c20b8880306 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Mon, 25 Feb 2019 18:27:55 +0200 Subject: [PATCH] Fixed missing symbol wctomb in libX11.a --- android/build.sh | 2 +- android/replacement_wctomb.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 android/replacement_wctomb.h diff --git a/android/build.sh b/android/build.sh index a1dd0e5cd..fc3267823 100755 --- a/android/build.sh +++ b/android/build.sh @@ -416,7 +416,7 @@ autoreconf -v --install \ env CFLAGS="-isystem$BUILDDIR/usr/include \ -isystem$BUILDDIR/../android-shmem \ - -include strings.h" \ + -I$BUILDDIR/.." \ LDFLAGS="-L$BUILDDIR" \ $BUILDDIR/setCrossEnvironment.sh \ LIBS="-lXau -lXdmcp -landroid_support -landroid-shmem" \ diff --git a/android/replacement_wctomb.h b/android/replacement_wctomb.h new file mode 100644 index 000000000..9d503548d --- /dev/null +++ b/android/replacement_wctomb.h @@ -0,0 +1,21 @@ +#include +#include + +/* Copied from Bionic libc */ +static int +replacement_wctomb(char *s, wchar_t wchar) +{ + static mbstate_t mbs; + size_t rval; + + if (s == NULL) { + /* No support for state dependent encodings. */ + memset(&mbs, 0, sizeof(mbs)); + return (0); + } + if ((rval = wcrtomb(s, wchar, &mbs)) == (size_t)-1) + return (-1); + return ((int)rval); +} + +#define wctomb replacement_wctomb