This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Ensure that version::_VERSION is always exported
authorJohn Peacock <jpeacock@cpan.org>
Sun, 29 Dec 2013 18:47:11 +0000 (13:47 -0500)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 4 Jan 2014 13:10:04 +0000 (05:10 -0800)
Now that version.pm doesn't mess with the symbol table, we need
to make sure that version::_VERSION exists at all times.  Also
change the name of the method that implements UNIVERSAL::VERSION
so that it is visually distinct and matches the other version.pm
derived methods.

vxs.inc

diff --git a/vxs.inc b/vxs.inc
index cb894f2..e297c38 100644 (file)
--- a/vxs.inc
+++ b/vxs.inc
 
 #ifdef VXS_XSUB_DETAILS
 #  ifdef PERL_CORE
-    {"UNIVERSAL::VERSION", XS_UNIVERSAL_VERSION, NULL},
-#  else
-    {VXS_CLASS "::_VERSION", VXS_UNIVERSAL_VERSION, NULL},
+    {"UNIVERSAL::VERSION", VXSp(universal_version), NULL},
 #  endif
+    {VXS_CLASS "::_VERSION", VXSp(universal_version), NULL},
     {VXS_CLASS "::()", VXSp(version_noop), NULL},
     {VXS_CLASS "::new", VXSp(version_new), NULL},
     {VXS_CLASS "::parse", VXSp(version_new), NULL},
@@ -67,7 +66,7 @@ typedef char HVNAME;
 #  define HEKf         "s"
 #endif
 
-VXS(UNIVERSAL_VERSION)
+VXS(universal_version)
 {
     dVAR;
     dXSARGS;