setjmp/longjmp

1 post / 0 new
afxgroup
afxgroup's picture
Offline
Last seen: 2 weeks 13 hours ago
Joined: 2011-02-03 15:26
setjmp/longjmp

(Crossposting from amigans)

I'm trying to make clib2 fully reentrant but I have a problem with setjmp/longjmp.
If I declare jmp_buf __exit_jmp_buf; globally (like in classic lib2 version) I have no problem and the longjmp works correctly.
But if I put it into my _clib2 struct that contains all variables, longjmp points to trashed memory.
I suspect it is an alignment problem (or something worst..)
I've tried to allocate the _clib2 struct with AVT_Alignment. I've also add pragma pack(2) but no luck. I've also tried to use a pointer to jmp_buf and then allocate it with AllocVecTags but always same problem.
I've also tried several longjmp/setjmp for PPC around internet but no luck..

Any hint?