Subject: | Compile fails on Strawberry Perl 5.20.2 MSWin32 |
CPAN installation of SetDualVar fails on Strawberry Perl for MSWin32 with the following error:
In file included from C:\STRAWB~1\perl\lib\CORE/perl.h:3335:0,
from SetDualVar.xs:2:
SetDualVar.xs: In function 'XS_SetDualVar_SetDualVar':
SetDualVar.xs:15:15: error: 'na' undeclared (first use in this function)
SvPV(string,na);
^
C:\STRAWB~1\perl\lib\CORE/sv.h:1673:10: note: in definition of macro 'SvPV_flags'
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
^
SetDualVar.xs:15:3: note: in expansion of macro 'SvPV'
SvPV(string,na);
^
SetDualVar.xs:15:15: note: each undeclared identifier is reported only once for each function it appears in
SvPV(string,na);
^
C:\STRAWB~1\perl\lib\CORE/sv.h:1673:10: note: in definition of macro 'SvPV_flags'
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
^
SetDualVar.xs:15:3: note: in expansion of macro 'SvPV'
SvPV(string,na);
^
dmake.exe: Error code 129, while making 'SetDualVar.o'
The attached patch fixes the problem.
Subject: | setDualVar_xs.patch |
--- SetDualVar.xs.orig 1995-09-28 08:00:10.000000000 -0400
+++ SetDualVar.xs 2015-08-27 22:43:09.819518700 -0400
@@ -12,6 +12,7 @@
SV * numeric
CODE:
{
+ STRLEN na;
SvPV(string,na);
if(!SvPOKp(string) || (!SvNOKp(numeric) && !SvIOKp(numeric)) ) {
croak("Usage: SetDualVar variable,string,numeric");