On 04/07/16 16:25, Father Chrysostomos wrote: > Tony Cook wrote: >> > Something like: >> > >> > 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. > Without the ampersand. Also, SvGETMAGIC is not an expression, but a statement, in 5.14 and earlier. If you want to support perl older than 5.16, you need to make it a separate statement: > > T_PV > SvGETMAGIC($arg); > $var = SvOK ($arg) ? ($type) SvPV_nomg($arg, PL_na) : NULL; > > (A typemap can be multiple statements, right?) /me hugs Tony Cook and Father Chrysostomos. Thanks, solved!Thread Previous | Thread Next