#define NEED_newSVpvn_flags_GLOBAL
#include "mop.h"
-void
-mop_call_xs (pTHX_ XSPROTO(subaddr), CV *cv, SV **mark)
-{
- dSP;
- PUSHMARK(mark);
- (*subaddr)(aTHX_ cv);
- PUTBACK;
-}
-
#if PERL_BCDVERSION >= 0x5010000
UV
mop_check_package_cache_flag (pTHX_ HV *stash)
#include "ppport.h"
-#define MOP_CALL_BOOT(name) mop_call_xs(aTHX_ name, cv, mark);
+#define MOP_CALL_BOOT(name) STMT_START { \
+ EXTERN_C XS(CAT2(boot_, name)); \
+ PUSHMARK(SP); \
+ CALL_FPTR(CAT2(boot_, name))(aTHX_ cv); \
+ } STMT_END
-void mop_call_xs (pTHX_ XSPROTO(subaddr), CV *cv, SV **mark);
#define MAKE_KEYSV(name) newSVpvn_share(#name, sizeof(#name)-1, 0U)
}
}
-EXTERN_C XS(boot_Class__MOP__Package);
-EXTERN_C XS(boot_Class__MOP__Class);
-EXTERN_C XS(boot_Class__MOP__Attribute);
-EXTERN_C XS(boot_Class__MOP__Instance);
-EXTERN_C XS(boot_Class__MOP__Method);
-EXTERN_C XS(boot_Class__MOP__Method__Accessor);
-EXTERN_C XS(boot_Class__MOP__Method__Constructor);
-
MODULE = Class::MOP PACKAGE = Class::MOP
PROTOTYPES: DISABLE
mop_isa = MAKE_KEYSV(isa);
mop_can = MAKE_KEYSV(can);
- MOP_CALL_BOOT (boot_Class__MOP__Package);
- MOP_CALL_BOOT (boot_Class__MOP__Class);
- MOP_CALL_BOOT (boot_Class__MOP__Attribute);
- MOP_CALL_BOOT (boot_Class__MOP__Instance);
- MOP_CALL_BOOT (boot_Class__MOP__Method);
- MOP_CALL_BOOT (boot_Class__MOP__Method__Accessor);
- MOP_CALL_BOOT (boot_Class__MOP__Method__Constructor);
+ MOP_CALL_BOOT( Class__MOP__Package );
+ MOP_CALL_BOOT( Class__MOP__Class );
+ MOP_CALL_BOOT( Class__MOP__Attribute );
+ MOP_CALL_BOOT( Class__MOP__Instance );
+ MOP_CALL_BOOT( Class__MOP__Method );
+ MOP_CALL_BOOT( Class__MOP__Method__Accessor );
+ MOP_CALL_BOOT( Class__MOP__Method__Constructor );
# use prototype here to be compatible with get_code_info from Sub::Identify
void