This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport NATIVE_TO_LATIN1, and vice-versa
authorKarl Williamson <khw@cpan.org>
Fri, 12 Jul 2019 17:32:03 +0000 (11:32 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:51:28 +0000 (16:51 -0600)
These are more accurate names than the original NATIVE_TO_ASCII, so
backport only these versions, to encourage their use.

Support only ASCII platforms in versions earlier than NATIVE_TO_ASCII
appeared in.

(cherry picked from commit 162b3fa5d025248e16c129ba4a4430567d7f4adf)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/inc/misc

index 579838b..35567a1 100644 (file)
@@ -285,6 +285,23 @@ typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
 # endif
 #endif
 
+/* On versions without this, only ASCII is supported */
+#ifdef NATIVE_TO_ASCII
+__UNDEFINED__ NATIVE_TO_LATIN1(c) NATIVE_TO_ASCII(c)
+#else
+__UNDEFINED__ NATIVE_TO_LATIN1(c) (c)
+#endif
+
+#ifdef ASCII_TO_NATIVE
+__UNDEFINED__ LATIN1_TO_NATIVE(c) ASCII_TO_NATIVE(c)
+#else
+__UNDEFINED__ LATIN1_TO_NATIVE(c) (c)
+#endif
+
+/* Warning: LATIN1_TO_NATIVE, NATIVE_TO_LATIN1
+   EBCDIC is not supported on versions earlier than 5.7.1
+ */
+
 #ifdef EBCDIC
 
 /* This is the first version where these macros are fully correct.  Relying on