diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-02-20 10:39:48 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-08-29 09:55:53 -0600 |
commit | 3d81eea60b810797ecb1123661164802c8a1984b (patch) | |
tree | df91bff760ad143fce87d29c0edb4d46a76d2a75 /utf8.h | |
parent | 5ff03569b606b06e31e418f9ef484ed4fc71babc (diff) | |
download | perl-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 'utf8.h')
-rw-r--r-- | utf8.h | 3 |
1 files changed, 0 insertions, 3 deletions
@@ -122,9 +122,6 @@ END_EXTERN_C /* Transforms in wide UV chars */ #define UNI_TO_NATIVE(ch) (ch) #define NATIVE_TO_UNI(ch) (ch) -/* Transforms in invariant space */ -#define NATIVE_TO_NEED(enc,ch) (ch) -#define ASCII_TO_NEED(enc,ch) (ch) /* As there are no translations, avoid the function wrapper */ #define utf8n_to_uvchr utf8n_to_uvuni |