summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorichizok <gclient.gaap@gmail.com>2021-05-27 18:05:14 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-27 18:05:14 +0200
commit543467136f001708f4c63376ac5d18adde82db30 (patch)
treef4bfa17e87eb7f76f20c776d938926e8b2c6d34c
parent840f91f110c4790a145e76eec453326445290f21 (diff)
downloadvim-git-543467136f001708f4c63376ac5d18adde82db30.tar.gz
patch 8.2.2891: cannot build with Perl 5.34v8.2.2891
Problem: Cannot build with Perl 5.34. Solution: Add Perl_SvTRUE_common(). (Ozaki Kiichi, closes #8266, closes #8250)
-rw-r--r--src/if_perl.xs31
-rw-r--r--src/version.c2
2 files changed, 32 insertions, 1 deletions
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
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2891,
+/**/
2890,
/**/
2889,