lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


James Zhao wrote:
> Does the Coco gcc inline asm code also work for switching C++ stacks (I'm
> thinking calling conventions may be a bit different)?

C++ mainly differs here wrt. exception handling. This should be
independent of stack switching on Linux, i.e. just give it a try.
On Windows, Coco relies on Fibers to switch exception contexts.

The other issue with C++ is name mangling. If you compile Lua+Coco
as C++ code, you need to add three lines before the coco_wrap_main
declaration in lcoco.c (reported by Jonathan Sauer):

#if defined(__cplusplus)
extern "C"
#endif
void coco_wrap_main(void);

Actually I have a couple more pending changes for Coco 1.1.5
(nothing critical). But a new release is still on hold -- I'm
waiting for the eventual release of Lua 5.1.5 (to avoid doing yet
another patch to get back in sync). Dunno when or if that will
happen, though. :-|

--Mike