[PATCH] [libcxx] Fix regex_traits<T>::char_class_type for Android.

Dan Albert danalbert at google.com
Wed Jul 23 16:50:33 PDT 2014


Hi mclow.lists, EricWF,

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.

This change depends on http://reviews.llvm.org/D4642.

http://reviews.llvm.org/D4648

Files:
  include/regex

Index: include/regex
===================================================================
--- include/regex
+++ include/regex
@@ -962,9 +962,18 @@
     typedef _CharT                  char_type;
     typedef basic_string<char_type> 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<char_type>* __ct_;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4648.11827.patch
Type: text/x-patch
Size: 654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140723/68784f47/attachment.bin>


More information about the cfe-commits mailing list