summaryrefslogtreecommitdiff
path: root/utfebcdic.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-02-20 10:39:48 -0700
committerKarl Williamson <public@khwilliamson.com>2013-08-29 09:55:53 -0600
commit3d81eea60b810797ecb1123661164802c8a1984b (patch)
treedf91bff760ad143fce87d29c0edb4d46a76d2a75 /utfebcdic.h
parent5ff03569b606b06e31e418f9ef484ed4fc71babc (diff)
downloadperl-3d81eea60b810797ecb1123661164802c8a1984b.tar.gz
Deprecate NATIVE_TO_NEED and ASCII_TO_NEED
These macros are no longer called in the Perl core. This commit turns them into functions so that they can use gcc's deprecation facility. I believe these were defective right from the beginning, and I have struggled to understand what's going on. From the name, it appears NATIVE_TO_NEED taks a native byte and turns it into UTF-8 if the appropriate parameter indicates that. But that is impossible to do correctly from that API, as for variant characters, it needs to return two bytes. It could only work correctly if ch is an I8 byte, which isn't native, and hence the name would be wrong. Similar arguments for ASCII_TO_NEED. The function S_append_utf8_from_native_byte(const U8 byte, U8** dest) does what I think NATIVE_TO_NEED intended.
Diffstat (limited to 'utfebcdic.h')
-rw-r--r--utfebcdic.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/utfebcdic.h b/utfebcdic.h
index ec342b5623..766c9770e3 100644
--- a/utfebcdic.h
+++ b/utfebcdic.h
@@ -531,14 +531,6 @@ END_EXTERN_C
#define NATIVE_TO_UNI(ch) (((ch) > 255) ? (ch) : NATIVE_TO_LATIN1(ch))
#define UNI_TO_NATIVE(ch) (((ch) > 255) ? (ch) : LATIN1_TO_NATIVE(ch))
-/* Transform in invariant..byte space */
-#define NATIVE_TO_NEED(enc,ch) ((enc) \
- ? I8_TO_NATIVE_UTF8(NATIVE_TO_LATIN1(ch)) \
- : (ch))
-#define ASCII_TO_NEED(enc,ch) ((enc) \
- ? I8_TO_NATIVE_UTF8(ch) \
- : LATIN1_TO_NATIVE(ch))
-
/*
The following table is adapted from tr16, it shows I8 encoding of Unicode code points.