File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ __UNDEFINED__
7676# endif
7777#endif
7878
79+ /* not as efficient as the real thing, but it works */
80+ __UNDEFINED__ SvREFCNT_dec_NN(sv) SvREFCNT_dec(sv)
81+
7982__UNDEFINED__ SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
8083__UNDEFINED__ SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
8184__UNDEFINED__ SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
@@ -110,13 +113,15 @@ SvREFCNT()
110113 mXPUSHi(SvREFCNT(sv) == 8);
111114 SvREFCNT_inc_simple_void_NN(sv);
112115 mXPUSHi(SvREFCNT(sv) == 9);
116+ SvREFCNT_dec_NN(sv);
117+ mXPUSHi(SvREFCNT(sv) == 8);
113118 while (SvREFCNT(sv) > 1)
114119 SvREFCNT_dec(sv);
115120 mXPUSHi(SvREFCNT(sv) == 1);
116121 SvREFCNT_dec(sv);
117- XSRETURN(14 );
122+ XSRETURN(15 );
118123
119- =tests plan => 14
124+ =tests plan => 15
120125
121126for (Devel::PPPort::SvREFCNT()) {
122127 ok(defined $_ and $_);
Original file line number Diff line number Diff line change 1414#ifndef sv_dup_inc
1515# define sv_dup_inc (s ,t ) SvREFCNT_inc(sv_dup(s,t))
1616#endif
17- #ifndef SvREFCNT_dec_NN
18- # define SvREFCNT_dec_NN (x ) SvREFCNT_dec(x)
19- #endif
2017#ifndef PERL_UNUSED_RESULT
2118# if defined(__GNUC__ ) && defined(HASATTRIBUTE_WARN_UNUSED_RESULT )
2219# define PERL_UNUSED_RESULT (v ) STMT_START { __typeof__(v) z = (v); (void)sizeof(z); } STMT_END
You can’t perform that action at this time.
0 commit comments