Skip to content

Commit 9f64cab

Browse files
committed
Convert uv_to_utf8_msgs() to a macro
This was an inline function; it would have originally been a macro if we didn't have to worry about thread context. The previous commit allows us to not have to consider that.
1 parent 93f23f0 commit 9f64cab

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

embed.fnc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3840,7 +3840,7 @@ Adip |U8 * |uv_to_utf8_flags \
38403840
|NN U8 *d \
38413841
|UV uv \
38423842
|UV flags
3843-
Adip |U8 * |uv_to_utf8_msgs|NN U8 *d \
3843+
Admp |U8 * |uv_to_utf8_msgs|NN U8 *d \
38443844
|UV uv \
38453845
|UV flags \
38463846
|NULLOK HV **msgs

embed.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,6 @@
825825
# define utf8n_to_uvchr_msgs Perl_utf8n_to_uvchr_msgs
826826
# define uv_to_utf8(a,b) Perl_uv_to_utf8(aTHX_ a,b)
827827
# define uv_to_utf8_flags(a,b,c) Perl_uv_to_utf8_flags(aTHX_ a,b,c)
828-
# define uv_to_utf8_msgs(a,b,c,d) Perl_uv_to_utf8_msgs(aTHX_ a,b,c,d)
829828
# define uvoffuni_to_utf8_flags_msgs(a,b,c,d) Perl_uvoffuni_to_utf8_flags_msgs(aTHX_ a,b,c,d)
830829
# define valid_identifier_pve(a,b,c) Perl_valid_identifier_pve(aTHX_ a,b,c)
831830
# define valid_identifier_pvn(a,b,c) Perl_valid_identifier_pvn(aTHX_ a,b,c)
@@ -2259,8 +2258,11 @@
22592258
# define PerlIO_write(a,b,c) Perl_PerlIO_write(aTHX_ a,b,c)
22602259
# endif /* defined(USE_PERLIO) */
22612260
# if defined(USE_THREADS)
2261+
# define Perl_uv_to_utf8_msgs(mTHX,a,b,c,d) uv_to_utf8_msgs(a,b,c,d)
22622262
# define thread_locale_init() Perl_thread_locale_init(aTHX)
22632263
# define thread_locale_term() Perl_thread_locale_term(aTHX)
2264+
# else
2265+
# define Perl_uv_to_utf8_msgs uv_to_utf8_msgs
22642266
# endif
22652267
# if defined(VMS) || defined(WIN32)
22662268
# define do_aspawn(a,b,c) Perl_do_aspawn(aTHX_ a,b,c)

inline.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3284,12 +3284,6 @@ Perl_uv_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags)
32843284
return uv_to_utf8_msgs(d, uv, flags, 0);
32853285
}
32863286

3287-
PERL_STATIC_INLINE U8 *
3288-
Perl_uv_to_utf8_msgs(pTHX_ U8 *d, UV uv, UV flags , HV **msgs)
3289-
{
3290-
return uvoffuni_to_utf8_flags_msgs(d, NATIVE_TO_UNI(uv), flags, msgs);
3291-
}
3292-
32933287
/* ------------------------------- perl.h ----------------------------- */
32943288

32953289
/*

proto.h

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utf8.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ typedef enum {
149149
#define uvchr_to_utf8_flags uv_to_utf8_flags
150150
#define uvchr_to_utf8_flags_msgs uv_to_utf8_msgs
151151

152+
#define uv_to_utf8_msgs(d, uv, flags, msgs) \
153+
uvoffuni_to_utf8_flags_msgs(d, NATIVE_TO_UNI(uv), flags, msgs)
154+
152155
/* This is needed to cast the parameters for all those calls that had them
153156
* improperly as chars */
154157
#define utf8_to_uvchr_buf(s, e, lenp) \

0 commit comments

Comments
 (0)