summaryrefslogtreecommitdiff
path: root/dist/Devel-PPPort/parts/inc/misc
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-10-09 09:05:06 -0600
committerNicolas R <atoomic@cpan.org>2019-11-08 12:01:12 -0700
commit2375c233f070b2b2914f995dfd608028bed92cde (patch)
treee28bd6355b48200bbbe62723460b46d8db1c9692 /dist/Devel-PPPort/parts/inc/misc
parent76269f46d9763e6e317403a17d3b109522af7901 (diff)
downloadperl-2375c233f070b2b2914f995dfd608028bed92cde.tar.gz
parts/inc/misc: Backport UNI to/from NATIVE
And change the way we setup similar defines. On perls before EBCDIC existed, these simply return their arguments. But a module now can unconditionally include these, and it will do the right thing. (cherry picked from commit e836478411ddc77f5155d0fd4e4f2a25f28dc47e) Signed-off-by: Nicolas R <atoomic@cpan.org>
Diffstat (limited to 'dist/Devel-PPPort/parts/inc/misc')
-rw-r--r--dist/Devel-PPPort/parts/inc/misc16
1 files changed, 8 insertions, 8 deletions
diff --git a/dist/Devel-PPPort/parts/inc/misc b/dist/Devel-PPPort/parts/inc/misc
index 1743e5d6b3..a58e8252eb 100644
--- a/dist/Devel-PPPort/parts/inc/misc
+++ b/dist/Devel-PPPort/parts/inc/misc
@@ -284,20 +284,20 @@ typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
# endif
#endif
-/* On versions without this, only ASCII is supported */
-#ifdef NATIVE_TO_ASCII
+/* On versions without NATIVE_TO_ASCII, only ASCII is supported */
+#if defined(EBCDIC) && defined(NATIVE_TO_ASCI)
__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)
+__UNDEFINED__ NATIVE_TO_UNI(c) ((c) > 255 ? (c) : NATIVE_TO_LATIN1(c))
+__UNDEFINED__ UNI_TO_NATIVE(c) ((c) > 255 ? (c) : LATIN1_TO_NATIVE(c))
#else
+__UNDEFINED__ NATIVE_TO_LATIN1(c) (c)
__UNDEFINED__ LATIN1_TO_NATIVE(c) (c)
+__UNDEFINED__ NATIVE_TO_UNI(c) (c)
+__UNDEFINED__ UNI_TO_NATIVE(c) (c)
#endif
-/* Warning: LATIN1_TO_NATIVE, NATIVE_TO_LATIN1
+/* Warning: LATIN1_TO_NATIVE, NATIVE_TO_LATIN1 NATIVE_TO_UNI UNI_TO_NATIVE
EBCDIC is not supported on versions earlier than 5.7.1
*/