C (73/254)

From:Allan Odgaard
Date:20 Apr 00 at 12:09:16
Subject:Re: How to change stack

On 20-Apr-00, Andrzej J. Debicki wrote:

> Thanks. I wrote some test proggy. But something id wrong. It hangs on
> first StackSwap func. Can someone help me to solve that?

> #include <exec/memory.h>
> #include <exec/types.h>
> #include <clib/alib_protos.h>

I haven't got time to investigate it further right now, but try to include
'proto/exec.h' -- without it the compiler will generate an external reference
for the symbol StackSwap(). The stub function is present in amiga.lib and
later linked to your library, but this scheme doesn't work, because you can't
return from a function (stub) without first changing back the stack, as that's
where the return address is found.
By including the pragmas the compiler will know it's a lib function and should
do the library call inline...

Regards Allan

------------------------------------------------------------------------
Good friends, school spirit, hair-dos you'd like to forget.
Classmates.com has them all. And with 4.4 million alumni already
registered, there's a good chance you'll find your friends here:
http://click.egroups.com/1/2885/1/_/451227/_/956229101/
------------------------------------------------------------------------