From e7a75ccf2d8d34a609bb66ec74f57e6b0fc89067 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 22 Jul 2014 18:37:52 -0700 Subject: [PATCH] Fix regex_traits::char_class_type for Android. Android can't use ctype_base::mask for its char_class_type because the bionic ctype implementation comes from openbsd, which uses an 8-bit ctype mask which isn't large enough to encode the standard ctypes and __regex_word. Change-Id: Iee4b8dd465ff2cb358ed2b10e1c3a499437403b7 --- include/regex | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/regex b/include/regex index 5e1c37c64..f84fb4344 100644 --- a/include/regex +++ b/include/regex @@ -962,9 +962,18 @@ public: typedef _CharT char_type; typedef basic_string string_type; typedef locale locale_type; +#ifdef __ANDROID__ + typedef uint16_t char_class_type; +#else typedef ctype_base::mask char_class_type; +#endif +#ifdef __ANDROID__ + static const char_class_type __regex_word = 0x8000; +#else static const char_class_type __regex_word = 0x80; +#endif + private: locale __loc_; const ctype* __ct_;