summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2012-12-06 11:11:47 +0100
committerYves Orton <demerphq@gmail.com>2012-12-06 13:42:42 +0100
commit39a0f513a3472b239cae9745b3b89abe93b6ca79 (patch)
tree2683790ba1d31f1aeb44384f6c9a0267e2f10a27 /utf8.h
parent3ee084aa8474e0a47583aee63a88beeea5d4742f (diff)
downloadperl-39a0f513a3472b239cae9745b3b89abe93b6ca79.tar.gz
make regcharclass generate submacros if necessary to keep them short
Some compilers can't handle unexpanded macros longer than something like 8000 characters. So we split up long ones into sub macros to work around the problem
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/utf8.h b/utf8.h
index 3fbc28a206..1df972bba6 100644
--- a/utf8.h
+++ b/utf8.h
@@ -476,6 +476,11 @@ Perl's extended UTF-8 means we can have start bytes up to FF.
* takes on the order of 10 minutes to generate, and is never going to change.
* The EBCDIC equivalent hasn't been commented out in regcharclass.pl, so it
* should generate and run the correct stuff */
+/*
+ UTF8_CHAR: Matches utf8 from 1 to 4 bytes
+
+ 0x0 - 0x1FFFFF
+*/
/*** GENERATED CODE ***/
#define is_UTF8_CHAR_utf8_safe(s,e) \
( ((e)-(s) > 3) ? \
@@ -488,23 +493,17 @@ Perl's extended UTF-8 means we can have start bytes up to FF.
( ( ( ( ((U8*)s)[1] & 0xC0 ) == 0x80 ) && ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ) ? 3 : 0 )\
: ( 0xF0 == ((U8*)s)[0] ) ? \
( ( ( ( 0x90 <= ((U8*)s)[1] && ((U8*)s)[1] <= 0xBF ) && ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ) && ( ( ((U8*)s)[3] & 0xC0 ) == 0x80 ) ) ? 4 : 0 )\
- : ( 0xF1 <= ((U8*)s)[0] && ((U8*)s)[0] <= 0xF7 ) ? \
- ( ( ( ( ( ((U8*)s)[1] & 0xC0 ) == 0x80 ) && ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ) && ( ( ((U8*)s)[3] & 0xC0 ) == 0x80 ) ) ? 4 : 0 )\
- : 0 ) \
+ : ( ( ( ( 0xF1 <= ((U8*)s)[0] && ((U8*)s)[0] <= 0xF7 ) && ( ( ((U8*)s)[1] & 0xC0 ) == 0x80 ) ) && ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ) && ( ( ((U8*)s)[3] & 0xC0 ) == 0x80 ) ) ? 4 : 0 )\
: ((e)-(s) > 2) ? \
( ( ( ((U8*)s)[0] & 0x80 ) == 0x00 ) ? 1 \
: ( 0xC2 <= ((U8*)s)[0] && ((U8*)s)[0] <= 0xDF ) ? \
( ( ( ((U8*)s)[1] & 0xC0 ) == 0x80 ) ? 2 : 0 ) \
: ( 0xE0 == ((U8*)s)[0] ) ? \
( ( ( ( ((U8*)s)[1] & 0xE0 ) == 0xA0 ) && ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ) ? 3 : 0 )\
- : ( 0xE1 <= ((U8*)s)[0] && ((U8*)s)[0] <= 0xEF ) ? \
- ( ( ( ( ((U8*)s)[1] & 0xC0 ) == 0x80 ) && ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ) ? 3 : 0 )\
- : 0 ) \
+ : ( ( ( 0xE1 <= ((U8*)s)[0] && ((U8*)s)[0] <= 0xEF ) && ( ( ((U8*)s)[1] & 0xC0 ) == 0x80 ) ) && ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ) ? 3 : 0 )\
: ((e)-(s) > 1) ? \
( ( ( ((U8*)s)[0] & 0x80 ) == 0x00 ) ? 1 \
- : ( 0xC2 <= ((U8*)s)[0] && ((U8*)s)[0] <= 0xDF ) ? \
- ( ( ( ((U8*)s)[1] & 0xC0 ) == 0x80 ) ? 2 : 0 ) \
- : 0 ) \
+ : ( ( 0xC2 <= ((U8*)s)[0] && ((U8*)s)[0] <= 0xDF ) && ( ( ((U8*)s)[1] & 0xC0 ) == 0x80 ) ) ? 2 : 0 )\
: ((e)-(s) > 0) ? \
( ( ((U8*)s)[0] & 0x80 ) == 0x00 ) \
: 0 )