diff options
authorRobin Burchell <>2012-05-01 20:35:31 +0200
committerQt by Nokia <>2012-05-03 16:11:58 +0200
commitf02acb8bfc3a4b242b9cc494050f2a93eb802b80 (patch)
parenteb9474d045e5acc23ed125a835e7bc5d66395d69 (diff)
Work around std::wstring not being defined on Android.
libstdc++ requires wchar.h (which bionic provides), but it also requires additional functionality which bionic does not provide, thus, std::wstring proper basically doesn't exist. Provide a compatibility shim so we can keep API intact. This feature existed in a similar guise in the past, but was removed in d868c9945a188d6ad22e0b7d6d24ac7fca00ab4e. Change-Id: I6cab6f41d04ad9dde97e3ce73506f9d8a42043fb Reviewed-by: Thiago Macieira <>
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 5b6869d111..3d0de55ed7 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -49,6 +49,15 @@
#include <string>
+#if defined(Q_OS_LINUX_ANDROID)
+// std::wstring is disabled on android's glibc, as bionic lacks certain features
+// that libstdc++ checks for (like mbcslen).
+namespace std
+ typedef basic_string<wchar_t> wstring;
#include <stdarg.h>
#ifdef truncate