summaryrefslogtreecommitdiff
path: root/include/__locale
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2014-07-10 15:20:28 +0000
committerMarshall Clow <mclow.lists@gmail.com>2014-07-10 15:20:28 +0000
commita64392627edf2f8f1ac80db5cd1cadd082269e13 (patch)
tree70a377bd57e355f754ea706bcd11e07b97b5ea3d /include/__locale
parent7778249d2d036e4de2dcdd75a50130dd3a88e65f (diff)
Add support for BIONIC C library (Android). Patch from Dan Albert
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/__locale')
-rw-r--r--include/__locale15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/__locale b/include/__locale
index fb5b196ca..3daa1f1b6 100644
--- a/include/__locale
+++ b/include/__locale
@@ -23,9 +23,16 @@
# include <support/win32/locale_win32.h>
#elif defined(_AIX)
# include <support/ibm/xlocale.h>
-#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)) || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)
+#elif defined(__ANDROID__)
+// Android gained the locale aware functions in L (API level 21)
+# include <android/api-level.h>
+# if __ANDROID_API__ <= 20
+# include <support/android/locale_bionic.h>
+# endif
+#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
+ || defined(__sun__) || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
# include <xlocale.h>
-#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
+#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -341,13 +348,15 @@ public:
static const mask punct = _PUNCT;
static const mask xdigit = _HEX;
static const mask blank = _BLANK;
-#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__) || defined(__ANDROID__)
#ifdef __APPLE__
typedef __uint32_t mask;
#elif defined(__FreeBSD__)
typedef unsigned long mask;
#elif defined(__EMSCRIPTEN__) || defined(__NetBSD__)
typedef unsigned short mask;
+#elif defined(__ANDROID__)
+ typedef char mask;
#endif
static const mask space = _CTYPE_S;
static const mask print = _CTYPE_R;