On Sat, Nov 06, 2004 at 09:25:05PM +1100 Stanley Hopcroft wrote:

> Dear Ladies and Gentlemen,
> 
> It comes as no suprise when my program fails to compile/link, but when
> the stack fiddling example from PerlEmbed does (power.c/power.pl),
> perhaps something more sinister is afoot.

This is threads-related (note that your perl has useithreads=define). In
a thusly configured perl, many functions and macros of the perlapi need
to have the thread-context in scope. This is achieved by providing the
(aTHX|pTHX)_ macros. So PerlPower probably needs to be prototyped like
this:

    static void
    PerlPower(pTHX_ int a, int b)
    {
        ...
    }

and called this way:

    PerlPower(aTHX_ 3, 4);

Those macros are empty when your perl is not threaded. Also, for
functions not receiving any argument, you use pTHX and aTHX which is the
same as their underscore-counterpart only that they don't contain a
comma in their expansion.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval

Reply via email to