summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-06-26 15:49:13 -0600
committerKarl Williamson <khw@cpan.org>2014-05-31 10:14:05 -0600
commite8fa43e2ca41ae473bc46c1faaddd42b50dbedcf (patch)
treed106dadf135ad0f323c6729faf84f3e0d389ce60 /handy.h
parent173ee337ccae1a3f75728b24e42392c298525e81 (diff)
downloadperl-e8fa43e2ca41ae473bc46c1faaddd42b50dbedcf.tar.gz
handy.h: Make macro more efficient on EBCDIC
The comments say it all
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/handy.h b/handy.h
index e4e5292d7a..44dc64d353 100644
--- a/handy.h
+++ b/handy.h
@@ -1550,7 +1550,15 @@ EXTCONST U32 PL_charclass[];
utf8, the non-utf8 macro works
*/
#define isBLANK_utf8(p) _generic_func_utf8(_CC_BLANK, is_HORIZWS_high, p)
-#define isCNTRL_utf8(p) _generic_utf8(_CC_CNTRL, p, 0)
+
+#ifdef EBCDIC
+ /* Because all controls are UTF-8 invariants in EBCDIC, we can use this
+ * more efficient macro instead of the more general one */
+# define isCNTRL_utf8(p) isCNTRL_L1(p)
+#else
+# define isCNTRL_utf8(p) _generic_utf8(_CC_CNTRL, p, 0)
+#endif
+
#define isDIGIT_utf8(p) _generic_utf8_no_upper_latin1(_CC_DIGIT, p, \
_is_utf8_FOO(_CC_DIGIT, p))
#define isGRAPH_utf8(p) _generic_swash_utf8(_CC_GRAPH, p)