diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-03-25 13:09:09 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-09-10 21:02:58 -0600 |
commit | 6f2d5cbcfe6275cad930b63e81bfd159b3964944 (patch) | |
tree | e0394a94a69d8e3922dffab69c5ea80399aef261 /utf8.h | |
parent | c11b1469027c6226458c10ea61522ddcdbee226c (diff) | |
download | perl-6f2d5cbcfe6275cad930b63e81bfd159b3964944.tar.gz |
Use separate macros for byte vs uv Unicode
This removes a macro not yet even in a development release, and splits
its calls into two classes: those where the input is a byte; and those
where it can be any unsigned integer. The byte implementation avoids a
function call on EBCDIC platforms.
Diffstat (limited to 'utf8.h')
-rw-r--r-- | utf8.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -338,7 +338,12 @@ Perl's extended UTF-8 means we can have start bytes up to FF. * UTF-8 encoded string) */ #define UTF8_IS_INVARIANT(c) UNI_IS_INVARIANT(NATIVE_UTF8_TO_I8(c)) -#define NATIVE_IS_INVARIANT(c) UNI_IS_INVARIANT(NATIVE_TO_LATIN1(c)) +/* Like the above, but its name implies a non-UTF8 input, and is implemented + * differently (for no particular reason) */ +#define NATIVE_BYTE_IS_INVARIANT(c) UNI_IS_INVARIANT(NATIVE_TO_LATIN1(c)) + +/* Like the above, but accepts any UV as input */ +#define UVCHR_IS_INVARIANT(uv) UNI_IS_INVARIANT(NATIVE_TO_UNI(uv)) #define MAX_PORTABLE_UTF8_TWO_BYTE 0x3FF /* constrained by EBCDIC */ |