you don't need that pushmark stuff if you're only chaining one xs module. what's documented in the ExtUtils::MakeMaker FAQ should work:
http://perldoc.perl.org/ExtUtils/MakeMaker/FAQ.html#XS This is what's suggested there. BOOT: # boot the second XS file boot_Cool__Bar(aTHX_ cv); Cool::Bar is the name of the package. For one chained xs module, it's pretty simple. For more than one chain, there is some stack correction needed. The stuff described here seems to do the trick. http://lethargy.org/~jesus/writes/perl-dynaloader-obscurity this is what's suggested there: #define crutch_stack_wrap(directive) do { \ PUSHMARK(SP); \ PUTBACK; \ directive; \ SPAGAIN; \ PUTBACK; \ } while(0) BOOT: crutch_stack_wrap(boot_Base__Foo(aTHX_ cv)); crutch_stack_wrap(boot_Base__Bar(aTHX_ cv)); crutch_stack_wrap(boot_Base__Quux(aTHX_ cv)); glib and gtk seem to use the same sort of method, although it looks like some shortcuts were taken. -rob On Fri, Oct 14, 2011 at 5:00 AM, Torsten Schoenfeld <[email protected]> wrote: > On 14.10.2011 08:11, Jeffrey Ratcliffe wrote: >> >> On 12 October 2011 16:00, Torsten Schoenfeld<[email protected]> wrote: >>> >>> Looks like Glib's mechanism is not C++-safe: specifically, the "extern >>> XS" >>> trick does not work because boot_Foo is already inside an<extern "C"> >>> section. Try this: >> >> It didn't help - same error message. > > Weird; worked for me. The DynaLoader approach looks fine too, though. >
