From: ichizok Date: Thu, 27 May 2021 16:05:14 +0000 (+0200) Subject: patch 8.2.2891: cannot build with Perl 5.34 X-Git-Tag: v8.2.2891 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=543467136f001708f4c63376ac5d18adde82db30;p=vim patch 8.2.2891: cannot build with Perl 5.34 Problem: Cannot build with Perl 5.34. Solution: Add Perl_SvTRUE_common(). (Ozaki Kiichi, closes #8266, closes #8250) --- diff --git a/src/if_perl.xs b/src/if_perl.xs index 999dff50e..3b0fead5d 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -700,12 +700,41 @@ S_POPMARK(pTHX) /* perl-5.32 needs Perl_POPMARK */ # if (PERL_REVISION == 5) && (PERL_VERSION >= 32) # define Perl_POPMARK S_POPMARK +# endif + +/* perl-5.34 needs Perl_SvTRUE_common; used in SvTRUE_nomg_NN */ +# if (PERL_REVISION == 5) && (PERL_VERSION >= 34) +PERL_STATIC_INLINE bool +Perl_SvTRUE_common(pTHX_ SV * sv, const bool sv_2bool_is_fallback) +{ + if (UNLIKELY(SvIMMORTAL_INTERP(sv))) + return SvIMMORTAL_TRUE(sv); + + if (! SvOK(sv)) + return FALSE; + + if (SvPOK(sv)) + return SvPVXtrue(sv); + + if (SvIOK(sv)) + return SvIVX(sv) != 0; /* casts to bool */ + + if (SvROK(sv) && !(SvOBJECT(SvRV(sv)) && HvAMAGIC(SvSTASH(SvRV(sv))))) + return TRUE; + + if (sv_2bool_is_fallback) + return sv_2bool_nomg(sv); + + return isGV_with_GP(sv); +} +# endif /* perl-5.32 needs Perl_SvTRUE */ +# if (PERL_REVISION == 5) && (PERL_VERSION >= 32) PERL_STATIC_INLINE bool Perl_SvTRUE(pTHX_ SV *sv) { if (!LIKELY(sv)) - return FALSE; + return FALSE; SvGETMAGIC(sv); return SvTRUE_nomg_NN(sv); } diff --git a/src/version.c b/src/version.c index e61edc6a3..775c4f496 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2891, /**/ 2890, /**/