Use GvCV_set() for bleadperl
Fuji, Goro [Mon, 21 Feb 2011 01:15:13 +0000 (10:15 +0900)]
mouse.h
xs-src/MouseUtil.xs

diff --git a/mouse.h b/mouse.h
index 7207eeb..d53c704 100644 (file)
--- a/mouse.h
+++ b/mouse.h
@@ -18,6 +18,10 @@ AV* mouse_mro_get_linear_isa(pTHX_ HV* const stash);
 #endif /* !no_mro_get_linear_isa */
 #endif /* mro_get_package_gen */
 
+#ifndef GvCV_set
+#define GvCV_set(gv, cv) (GvCV(gv) = (cv))
+#endif
+
 extern SV* mouse_package;
 extern SV* mouse_methods;
 extern SV* mouse_name;
index 8d0c51a..3ec7d8c 100644 (file)
@@ -323,7 +323,7 @@ mouse_install_sub(pTHX_ GV* const gv, SV* const code_ref) {
 
     if(GvCVu(gv)){ /* delete *slot{gv} to work around "redefine" warning */
         SvREFCNT_dec(GvCV(gv));
-        GvCV(gv) = NULL;
+        GvCV_set(gv, NULL);
     }
 
     sv_setsv_mg((SV*)gv, code_ref); /* *gv = $code_ref */