This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
intrpvar.h: Add variable for use in tr///
authorKarl Williamson <khw@cpan.org>
Thu, 3 Oct 2019 04:34:37 +0000 (22:34 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 7 Nov 2019 04:22:24 +0000 (21:22 -0700)
This is part of this branch of changes.

embedvar.h
intrpvar.h
perl.c

index 259a534..120e5f7 100644 (file)
@@ -58,6 +58,7 @@
 #define PL_Sock                        (vTHX->ISock)
 #define PL_StdIO               (vTHX->IStdIO)
 #define PL_Sv                  (vTHX->ISv)
+#define PL_TR_SPECIAL_HANDLING_UTF8    (vTHX->ITR_SPECIAL_HANDLING_UTF8)
 #define PL_Xpv                 (vTHX->IXpv)
 #define PL_an                  (vTHX->Ian)
 #define PL_argvgv              (vTHX->Iargvgv)
index e28726b..94ac647 100644 (file)
@@ -900,6 +900,8 @@ PERLVARI(I, dump_re_max_len, STRLEN, 60)
 
 PERLVAR(I, internal_random_state, PL_RANDOM_STATE_TYPE)
 
+PERLVARA(I, TR_SPECIAL_HANDLING_UTF8, UTF8_MAXBYTES, char)
+
 /* If you are adding a U8 or U16, check to see if there are 'Space' comments
  * above on where there are gaps which currently will be structure padding.  */
 
diff --git a/perl.c b/perl.c
index cad0e22..d14da14 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -299,6 +299,9 @@ perl_construct(pTHXx)
     STATUS_ALL_SUCCESS;
 
     init_uniprops();
+    (void) uvchr_to_utf8_flags((U8 *) PL_TR_SPECIAL_HANDLING_UTF8,
+                               TR_SPECIAL_HANDLING,
+                               UNICODE_ALLOW_ABOVE_IV_MAX);
 
 #if defined(LOCAL_PATCH_COUNT)
     PL_localpatches = local_patches;   /* For possible -v */