This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document limitations in PUSHi et al macros and add new mPUSHi et al macros
[perl5.git] / universal.c
index b84e554..6b2214d 100644 (file)
@@ -1,6 +1,6 @@
 /*    universal.c
  *
- *    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ *    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  *    by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
@@ -369,12 +369,16 @@ XS(XS_UNIVERSAL_VERSION)
        }
 
        if ( vcmp( req, sv ) > 0 )
-           Perl_croak(aTHX_
-               "%s version %"SVf" required--this is only version %"SVf,
-               HvNAME(pkg), req, sv);
+           Perl_croak(aTHX_ "%s version %"SVf" (%"SVf") required--"
+                   "this is only version %"SVf" (%"SVf")", HvNAME(pkg),
+                   vnumify(req),vnormal(req),vnumify(sv),vnormal(sv));
     }
 
-    ST(0) = sv;
+    if ( sv_derived_from(sv, "version") ) {
+       ST(0) = vnumify(sv);
+    } else {
+       ST(0) = sv;
+    }
 
     XSRETURN(1);
 }