mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 7.4.1848
Problem: Can't build with Strawberry Perl 5.24. Solution: Define S_SvREFCNT_dec() if needed. (Damien, Ken Takata)
This commit is contained in:
@@ -299,6 +299,9 @@ typedef int perl_key;
|
||||
# define PerlIOBase_pushed dll_PerlIOBase_pushed
|
||||
# define PerlIO_define_layer dll_PerlIO_define_layer
|
||||
# endif
|
||||
# if (PERL_REVISION == 5) && (PERL_VERSION >= 24)
|
||||
# define Perl_savetmps dll_Perl_savetmps
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Declare HANDLE for perl.dll and function pointers.
|
||||
@@ -455,6 +458,9 @@ static NV (*Perl_sv_2nv_flags)(pTHX_ SV *const, const I32);
|
||||
static IV (*PerlIOBase_pushed)(pTHX_ PerlIO *, const char *, SV *, PerlIO_funcs *);
|
||||
static void (*PerlIO_define_layer)(pTHX_ PerlIO_funcs *);
|
||||
#endif
|
||||
#if (PERL_REVISION == 5) && (PERL_VERSION >= 24)
|
||||
static void (*Perl_savetmps)(pTHX);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Table of name to function pointer of perl.
|
||||
@@ -597,18 +603,28 @@ static struct {
|
||||
#if defined(PERLIO_LAYERS) && !defined(USE_SFIO)
|
||||
{"PerlIOBase_pushed", (PERL_PROC*)&PerlIOBase_pushed},
|
||||
{"PerlIO_define_layer", (PERL_PROC*)&PerlIO_define_layer},
|
||||
#endif
|
||||
#if (PERL_REVISION == 5) && (PERL_VERSION >= 24)
|
||||
{"Perl_savetmps", (PERL_PROC*)&Perl_savetmps},
|
||||
#endif
|
||||
{"", NULL},
|
||||
};
|
||||
|
||||
/* Work around for perl-5.18.
|
||||
* The definitions of S_SvREFCNT_inc and S_SvREFCNT_dec are needed, so include
|
||||
* "perl\lib\CORE\inline.h", after Perl_sv_free2 is defined.
|
||||
* The linker won't complain about undefined __impl_Perl_sv_free2. */
|
||||
* For now, only the definitions of S_SvREFCNT_dec are needed in
|
||||
* "perl\lib\CORE\inline.h". */
|
||||
#if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
|
||||
# define PL_memory_wrap "panic: memory wrap" /* Dummy */
|
||||
# include <inline.h>
|
||||
# undef PL_memory_wrap
|
||||
static void
|
||||
S_SvREFCNT_dec(pTHX_ SV *sv)
|
||||
{
|
||||
if (LIKELY(sv != NULL)) {
|
||||
U32 rc = SvREFCNT(sv);
|
||||
if (LIKELY(rc > 1))
|
||||
SvREFCNT(sv) = rc - 1;
|
||||
else
|
||||
Perl_sv_free2(aTHX_ sv, rc);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -777,7 +793,7 @@ newWINrv(SV *rv, win_T *ptr)
|
||||
sv_setiv(ptr->w_perl_private, PTR2IV(ptr));
|
||||
}
|
||||
else
|
||||
SvREFCNT_inc(ptr->w_perl_private);
|
||||
SvREFCNT_inc_void_NN(ptr->w_perl_private);
|
||||
SvRV(rv) = ptr->w_perl_private;
|
||||
SvROK_on(rv);
|
||||
return sv_bless(rv, gv_stashpv("VIWIN", TRUE));
|
||||
@@ -793,7 +809,7 @@ newBUFrv(SV *rv, buf_T *ptr)
|
||||
sv_setiv(ptr->b_perl_private, PTR2IV(ptr));
|
||||
}
|
||||
else
|
||||
SvREFCNT_inc(ptr->b_perl_private);
|
||||
SvREFCNT_inc_void_NN(ptr->b_perl_private);
|
||||
SvRV(rv) = ptr->b_perl_private;
|
||||
SvROK_on(rv);
|
||||
return sv_bless(rv, gv_stashpv("VIBUF", TRUE));
|
||||
|
@@ -753,6 +753,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1848,
|
||||
/**/
|
||||
1847,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user