Skip to content

Commit

Permalink
utf8.h: Add new #define for extended length UTF-8
Browse files Browse the repository at this point in the history
The previous commit added a convenient place to create a symbol to
indicate that the UTF-8 on this platform includes Perl's nearly-double
length extension.  The platforms this isn't needed on are 32-bit ASCII
ones.  This symbol allows removing one place where EBCDIC need
be considered, and future commits will use it as well.
  • Loading branch information
khwilliamson committed Aug 7, 2021
1 parent 03a8ddc commit 788cdc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion utf8.c
Expand Up @@ -894,7 +894,7 @@ S_does_utf8_overflow(const U8 * const s,
# endif
#endif

#if ! defined(UV_IS_QUAD) && ! defined(EBCDIC)
#ifndef HAS_EXTRA_LONG_UTF8

/* On 32 bit ASCII machines, many overlongs that start with FF don't
* overflow */
Expand Down
1 change: 1 addition & 0 deletions utf8.h
Expand Up @@ -448,6 +448,7 @@ regen/charset_translations.pl. */
* platforms, that doesn't happen until 6*6 bits, so on those platforms, this
* will always be false */
#if UVSIZE * CHARBITS > (6 * UTF_CONTINUATION_BYTE_INFO_BITS)
# define HAS_EXTRA_LONG_UTF8
# define OFFUNISKIP_helper_(uv) \
UNLIKELY(uv > nBIT_UMAX(6 * UTF_CONTINUATION_BYTE_INFO_BITS)) \
? UTF8_MAXBYTES :
Expand Down

0 comments on commit 788cdc6

Please sign in to comment.