Support perl >= 5.13.3
Florian Ragwitz [Tue, 7 Sep 2010 22:27:53 +0000 (00:27 +0200)]
5.13.3 made the GvCV a pure reader and adds GvCV_set to write that field.

Closes RT#59558.

Changes
Name.xs

diff --git a/Changes b/Changes
index 800eb30..741a0ec 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+    * Support perl >= 5.13.3 by using the new CvGV_set interface there
+      (Closes RT#59558).
     * Stop using the deprecated PL_no_symref (Closes RT#57843).
 
 0.04 -- Fri Jul 18 15:23 CEST 2008
diff --git a/Name.xs b/Name.xs
index 9b38b05..2c669bd 100644 (file)
--- a/Name.xs
+++ b/Name.xs
@@ -88,5 +88,9 @@ subname(name, sub)
                mg->mg_flags |= MGf_REFCOUNTED;
                mg->mg_obj = (SV *) gv;
        }
+#ifndef CvGV_set
        CvGV(cv) = gv;
+#else
+       CvGV_set(cv, gv);
+#endif
        PUSHs(sub);