Skip to content

Convert Perl utf16 to utf8 functions to macros #23554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -3772,7 +3772,7 @@ Adip |bool |utf8_to_bytes_overwrite \
Adip |bool |utf8_to_bytes_temp_pv \
|NN U8 const **s_ptr \
|NN STRLEN *lenp
EMXp |U8 * |utf16_to_utf8 |NN U8 *p \
Emp |U8 * |utf16_to_utf8 |NN U8 *p \
|NN U8 *d \
|Size_t bytelen \
|NN Size_t *newlen
Expand All @@ -3790,7 +3790,7 @@ EXpx |U8 * |utf8_to_utf16_base \
|NN Size_t *newlen \
|const bool high \
|const bool low
EMXp |U8 * |utf16_to_utf8_reversed \
Emp |U8 * |utf16_to_utf8_reversed \
|NN U8 *p \
|NN U8 *d \
|Size_t bytelen \
Expand Down
8 changes: 8 additions & 0 deletions embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,10 @@
# define Perl_whichsig(mTHX,a) whichsig(a)
# define thread_locale_init() Perl_thread_locale_init(aTHX)
# define thread_locale_term() Perl_thread_locale_term(aTHX)
# if defined(PERL_CORE) || defined(PERL_EXT)
# define Perl_utf16_to_utf8(mTHX,a,b,c,d) utf16_to_utf8(a,b,c,d)
# define Perl_utf16_to_utf8_reversed(mTHX,a,b,c,d) utf16_to_utf8_reversed(a,b,c,d)
# endif
# if defined(PERL_DONT_CREATE_GVSV)
# define Perl_gv_SVadd(mTHX,a) gv_SVadd(a)
# endif
Expand Down Expand Up @@ -2475,6 +2479,10 @@
# define Perl_uvchr_to_utf8_flags_msgs uvchr_to_utf8_flags_msgs
# define Perl_uvoffuni_to_utf8_flags uvoffuni_to_utf8_flags
# define Perl_whichsig whichsig
# if defined(PERL_CORE) || defined(PERL_EXT)
# define Perl_utf16_to_utf8 utf16_to_utf8
# define Perl_utf16_to_utf8_reversed utf16_to_utf8_reversed
# endif
# if defined(PERL_DONT_CREATE_GVSV)
# define Perl_gv_SVadd gv_SVadd
# endif
Expand Down
12 changes: 4 additions & 8 deletions proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -3454,22 +3454,6 @@ Perl_utf16_to_utf8_base(pTHX_ U8* p, U8* d, Size_t bytelen, Size_t *newlen,
return d;
}

U8*
Perl_utf16_to_utf8(pTHX_ U8* p, U8* d, Size_t bytelen, Size_t *newlen)
{
PERL_ARGS_ASSERT_UTF16_TO_UTF8;

return utf16_to_utf8(p, d, bytelen, newlen);
}

U8*
Perl_utf16_to_utf8_reversed(pTHX_ U8* p, U8* d, Size_t bytelen, Size_t *newlen)
{
PERL_ARGS_ASSERT_UTF16_TO_UTF8_REVERSED;

return utf16_to_utf8_reversed(p, d, bytelen, newlen);
}

/*
* Convert UTF-8 to native UTF-16. Called via the macros utf8_to_utf16() for
* big-endian and utf8_to_utf16_reversed() for little-endian,
Expand Down
Loading