summaryrefslogtreecommitdiff
path: root/utfebcdic.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-11-08 22:13:44 -0700
committerKarl Williamson <khw@cpan.org>2015-12-09 17:11:54 -0700
commit858cd8abc358948a5494c38ce06177d2cfb7607e (patch)
tree1d758bd8293536305dc854f4004c398f88755462 /utfebcdic.h
parentb18b15ad78b5378109acf3580bf85d23007801d6 (diff)
downloadperl-858cd8abc358948a5494c38ce06177d2cfb7607e.tar.gz
utf8.h, utfebcdic.h: Add #define
for future use
Diffstat (limited to 'utfebcdic.h')
-rw-r--r--utfebcdic.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/utfebcdic.h b/utfebcdic.h
index 3a4fcc28af..10b666afe2 100644
--- a/utfebcdic.h
+++ b/utfebcdic.h
@@ -205,8 +205,17 @@ above what a 64 bit word can hold */
* definitions. */
#define UTF8_IS_START(c) _generic_isCC(c, _CC_UTF8_IS_START)
+
+#define UTF_IS_CONTINUATION_MASK 0xE0
+
#define UTF8_IS_CONTINUATION(c) _generic_isCC(c, _CC_UTF8_IS_CONTINUATION)
+/* The above instead could be written as this:
+#define UTF8_IS_CONTINUATION(c) \
+ (((NATIVE_UTF8_TO_I8(c) & UTF_IS_CONTINUATION_MASK) \
+ == UTF_CONTINUATION_MARK)
+ */
+
/* Equivalent to ! UVCHR_IS_INVARIANT(c) */
#define UTF8_IS_CONTINUED(c) cBOOL(FITS_IN_8_BITS(c) \
&& ! (PL_charclass[(U8) (c)] & (_CC_mask(_CC_ASCII) | _CC_mask(_CC_CNTRL))))