X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=mop.h;h=830716f84592f889f7cb06e0c6b12c4e0298ba94;hb=topic%2Fdocument-instance-role-application;hp=5547745b6e6e67bf92c57a9334ca4d9c0b12e081;hpb=38bf2a2585e26a47c919fd4c286b7716acb51c00;p=gitmo%2FMoose.git diff --git a/mop.h b/mop.h index 5547745..830716f 100644 --- a/mop.h +++ b/mop.h @@ -10,10 +10,22 @@ #define NEED_sv_2pv_nolen #include "ppport.h" +/* In theory, ExtUtils::ParseXS provide backcompat for this. However, the only + * available version doing that right now is 3.03_02, which is a dev release. We + * don't want to depend on dev releases, so we copy the code here. It should be + * removed once there's a stable ExtUtils::ParseXS version newer than 3.03_02. */ +#ifndef XS_EXTERNAL +# define XS_EXTERNAL XS +#endif + #define MOP_CALL_BOOT(name) mop_call_xs(aTHX_ name, cv, mark); #ifndef XSPROTO -#define XSPROTO(name) XS(name) +#define XSPROTO(name) XS_EXTERNAL(name) +#endif + +#ifndef CvISXSUB +#define CvISXSUB(cv) (CvXSUB(cv) ? TRUE : FALSE) #endif void mop_call_xs (pTHX_ XSPROTO(subaddr), CV *cv, SV **mark); @@ -52,6 +64,7 @@ typedef enum { KEY_writer, KEY_package_cache_flag, KEY__version, + KEY_operator, key_last, } mop_prehashed_key_t; @@ -69,7 +82,7 @@ U32 mop_prehashed_hash_for (mop_prehashed_key_t key); CvXSUBANY(cv).any_i32 = KEY_ ##key; \ } -XS(mop_xs_simple_reader); +XS_EXTERNAL(mop_xs_simple_reader); extern SV *mop_method_metaclass; extern SV *mop_associated_metaclass;