develooper Front page | perl.perl5.porters | Postings from July 2016

Re: substr as parameter to a XS sub

Thread Previous
From:
=?UTF-8?Q?Alberto_Sim=c3=b5es?=
Date:
July 4, 2016 09:09
Subject:
Re: substr as parameter to a XS sub
Message ID:
e260e718-7967-2d84-3a90-3b665ff8dc78@alfarrabio.di.uminho.pt

>
> T_PV
>  	$var = (SvGETMAGIC($arg), SvOK ($arg)) ? ($type) SvPV_nomg_nolen($arg) : NULL
>
> should work.
>
> Use SvPV_nomg($arg, &PL_na) if you need to support perls older than 5.14.

Got this:

xscode/BibTeX.c:200:62: error: expression is not assignable
   ...SvOK (ST(0))) ? (char *) SvPV_nomg(ST(0), &PL_na) : NULL
                               ^                ~~~~~~

Thanks,
Alberto

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About