slim has asked for the wisdom of the Perl Monks concerning the following question:
to produce:for $i (1..100) { $r=C($i); print $r."\n" } use Inline C => <<'C_CODE'; int C (int i) { Inline_Stack_Vars; return i; Inline_Stack_Void; } C_CODE
I have also tryied the following version of C_CODE:... 94 95 96 97 98 99 100 Segmentation fault
getting:SV* C (SV* param) { Inline_Stack_Vars; int i = atoi(SvPV(Inline_Stack_Item(0), PL_na)); return newSVpvf("%i",i); Inline_Stack_Void; }
But if I declare SV* C (SV* param,...) it seems to work...1 0 0 Segmentation fault
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inline::C parameters
by dbp (Pilgrim) on Feb 24, 2003 at 01:37 UTC | |
by dbp (Pilgrim) on Feb 24, 2003 at 01:44 UTC |