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 /mathoms.c | |
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 'mathoms.c')
-rw-r--r-- | mathoms.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1213,6 +1213,21 @@ Perl_sv_mortalcopy(pTHX_ SV *const oldstr) return Perl_sv_mortalcopy_flags(aTHX_ oldstr, SV_GMAGIC); } +UV /* Made into a function, so can be deprecated */ +NATIVE_TO_NEED(const UV enc, const UV ch) +{ + PERL_UNUSED_ARG(enc); + return ch; +} + +UV /* Made into a function, so can be deprecated */ +ASCII_TO_NEED(const UV enc, const UV ch) +{ + PERL_UNUSED_ARG(enc); + return ch; +} + + END_EXTERN_C #endif /* NO_MATHOMS */ |