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 4822d3d..6b2214d 100644 (file)
@@ -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);
 }