From: gfx Date: Thu, 3 Dec 2009 01:37:11 +0000 (+0900) Subject: Rename a macro to define a class holder X-Git-Tag: 0.40_09~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=787f84c2e6971ebb69a12663cddbf3307c1ca371;p=gitmo%2FMouse.git Rename a macro to define a class holder --- diff --git a/mouse.h b/mouse.h index 718350c..efed6ca 100644 --- a/mouse.h +++ b/mouse.h @@ -147,10 +147,10 @@ void mouse_instance_weaken_slot(pTHX_ SV* const instance, SV* const slot); #define INSTALL_SIMPLE_READER_WITH_KEY(klass, name, key) \ (void)mouse_simple_accessor_generate(aTHX_ "Mouse::Meta::" #klass "::" #name, #key, sizeof(#key)-1, XS_Mouse_simple_reader, NULL, 0) -#define INSTALL_SIMPLE_READER_WITH_DEFAULTSV(klass, name, dsv) \ +#define INSTALL_CLASS_HOLDER_SV(klass, name, dsv) \ (void)mouse_simple_accessor_generate(aTHX_ "Mouse::Meta::" #klass "::" #name, #name, sizeof(#name)-1, XS_Mouse_simple_reader, (dsv), HEf_SVKEY) -#define INSTALL_SIMPLE_READER_WITH_DEFAULTS(klass, name, ds) \ - INSTALL_SIMPLE_READER_WITH_DEFAULTSV(klass, name, newSVpvs(ds)) +#define INSTALL_CLASS_HOLDER(klass, name, ds) \ + INSTALL_CLASS_HOLDER_SV(klass, name, newSVpvs(ds)) #define INSTALL_SIMPLE_WRITER(klass, name) \ NSTALL_SIMPLE_WRITER_WITH_KEY(klass, name, name) diff --git a/xs-src/Mouse.xs b/xs-src/Mouse.xs index 84d49f2..331b5bf 100644 --- a/xs-src/Mouse.xs +++ b/xs-src/Mouse.xs @@ -588,10 +588,10 @@ BOOT: INSTALL_SIMPLE_READER(Class, roles); INSTALL_SIMPLE_PREDICATE_WITH_KEY(Class, is_anon_class, anon_serial_id); - INSTALL_SIMPLE_READER_WITH_DEFAULTS(Class, method_metaclass, "Mouse::Meta::Method"); - INSTALL_SIMPLE_READER_WITH_DEFAULTS(Class, attribute_metaclass, "Mouse::Meta::Attribute"); - INSTALL_SIMPLE_READER_WITH_DEFAULTS(Class, constructor_class, "Mouse::Meta::Method::Constructor::XS"); - INSTALL_SIMPLE_READER_WITH_DEFAULTS(Class, destructor_class, "Mouse::Meta::Method::Destructor::XS"); + INSTALL_CLASS_HOLDER(Class, method_metaclass, "Mouse::Meta::Method"); + INSTALL_CLASS_HOLDER(Class, attribute_metaclass, "Mouse::Meta::Attribute"); + INSTALL_CLASS_HOLDER(Class, constructor_class, "Mouse::Meta::Method::Constructor::XS"); + INSTALL_CLASS_HOLDER(Class, destructor_class, "Mouse::Meta::Method::Destructor::XS"); newCONSTSUB(gv_stashpvs("Mouse::Meta::Method::Constructor::XS", TRUE), "_generate_constructor", newRV_inc((SV*)get_cvs("Mouse::Object::new", TRUE))); @@ -659,7 +659,7 @@ BOOT: INSTALL_SIMPLE_READER_WITH_KEY(Role, get_roles, roles); INSTALL_SIMPLE_PREDICATE_WITH_KEY(Role, is_anon_role, anon_serial_id); - INSTALL_SIMPLE_READER_WITH_DEFAULTS(Role, method_metaclass, "Mouse::Meta::Role::Method"); + INSTALL_CLASS_HOLDER(Role, method_metaclass, "Mouse::Meta::Role::Method"); MODULE = Mouse PACKAGE = Mouse::Object diff --git a/xs-src/MouseAttribute.xs b/xs-src/MouseAttribute.xs index 30163fb..2caf7be 100644 --- a/xs-src/MouseAttribute.xs +++ b/xs-src/MouseAttribute.xs @@ -218,5 +218,5 @@ BOOT: INSTALL_SIMPLE_PREDICATE_WITH_KEY(Attribute, has_builder, builder); INSTALL_SIMPLE_PREDICATE_WITH_KEY(Attribute, has_documentation, documentation); - INSTALL_SIMPLE_READER_WITH_DEFAULTS(Attribute, accessor_metaclass, "Mouse::Meta::Method::Accessor::XS"); + INSTALL_CLASS_HOLDER(Attribute, accessor_metaclass, "Mouse::Meta::Method::Accessor::XS");