diff options
Diffstat (limited to 'contrib/libc++/include/__locale')
-rw-r--r-- | contrib/libc++/include/__locale | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/contrib/libc++/include/__locale b/contrib/libc++/include/__locale index 6d75162..0097fc2 100644 --- a/contrib/libc++/include/__locale +++ b/contrib/libc++/include/__locale @@ -21,11 +21,22 @@ #include <locale.h> #if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) # include <support/win32/locale_win32.h> -#elif _AIX +#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(__sun__) +# include <support/solaris/xlocale.h> +#elif defined(_NEWLIB_VERSION) +# include <support/newlib/xlocale.h> +#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ + || 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 +352,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 unsigned char mask; #endif static const mask space = _CTYPE_S; static const mask print = _CTYPE_R; @@ -357,7 +370,12 @@ public: static const mask alpha = _CTYPE_A; static const mask digit = _CTYPE_D; static const mask punct = _CTYPE_P; +# if defined(__ANDROID__) + static const mask xdigit = _CTYPE_X | _CTYPE_D; +# else static const mask xdigit = _CTYPE_X; +# endif + # if defined(__NetBSD__) static const mask blank = _CTYPE_BL; # else |