/^--xs$/ and $use_xs = 1;
}
+if($] < 5.008_001){
+ $use_xs = 0;
+}
+
if(!defined $use_xs){
configure_requires 'ExtUtils::CBuilder';
require ExtUtils::CBuilder;
#include <perl.h>
#include <XSUB.h>
+#define NEED_newSVpvn_flags
#include "ppport.h"
+/* for portability */
#ifndef newSVpvs_share
#define newSVpvs_share(s) Perl_newSVpvn_share(aTHX_ s, sizeof(s)-1, 0U)
#endif
+#ifndef GvNAME_get
+#define GvNAME_get GvNAME
+#endif
+#ifndef GvNAMELEN_get
+#define GvNAMELEN_get GvNAMELEN
+#endif
+
#ifndef mro_get_linear_isa
#define no_mro_get_linear_isa
#define mro_get_linear_isa(stash) mouse_mro_get_linear_isa(aTHX_ stash)
-AV* mouse_mro_get_linear_isa(pTHX_ HV* const stash)
+AV* mouse_mro_get_linear_isa(pTHX_ HV* const stash);
#endif /* !mro_get_linear_isa */
#ifndef mro_get_pkg_gen
#endif /* !no_mro_get_linear_isa */
#endif /* mro_get_package_gen */
-#define MOUSE_CALL_BOOT(name) STMT_START { \
+#define MOUSE_CALL_BOOT(name) STMT_START { \
EXTERN_C XS(CAT2(boot_, name)); \
PUSHMARK(SP); \
CALL_FPTR(CAT2(boot_, name))(aTHX_ cv); \
namespace(SV* self)
CODE:
{
- SV* const package = mouse_instance_get_slot(self, mouse_package);
+ SV* const package = mouse_instance_get_slot(aTHX_ self, mouse_package);
if(!(package && SvOK(package))){
croak("No package name");
}
croak("Expected exactly one argument for a reader for '%"SVf"'", slot);
}
- value = mouse_instance_get_slot(self, slot);
+ value = mouse_instance_get_slot(aTHX_ self, slot);
ST(0) = value ? value : &PL_sv_undef;
XSRETURN(1);
}
croak("Expected exactly two argument for a writer for '%"SVf"'", slot);
}
- ST(0) = mouse_instance_set_slot(self, slot, ST(1));
+ ST(0) = mouse_instance_set_slot(aTHX_ self, slot, ST(1));
XSRETURN(1);
}
croak("Expected exactly one argument for a predicate for '%"SVf"'", slot);
}
- ST(0) = boolSV( mouse_instance_has_slot(self, slot) );
+ ST(0) = boolSV( mouse_instance_has_slot(aTHX_ self, slot) );
XSRETURN(1);
}
#define ISA_CACHE "::LINEALIZED_ISA_CACHE::"
-#ifndef no_mro_get_linear_isa
+#ifdef no_mro_get_linear_isa
AV*
mouse_mro_get_linear_isa(pTHX_ HV* const stash){
GV* const cachegv = *(GV**)hv_fetchs(stash, ISA_CACHE, TRUE);