applied suggested patch with whitespace adjustments
[p5sagit/p5-mst-13.2.git] / universal.c
index 63c6910..aa5487f 100644 (file)
@@ -103,9 +103,19 @@ Perl_sv_derived_from(pTHX_ SV *sv, const char *name)
  
 }
 
-#ifdef PERL_OBJECT
-#define NO_XSLOCKS
-#endif  /* PERL_OBJECT */
+void XS_UNIVERSAL_isa(pTHXo_ CV *cv);
+void XS_UNIVERSAL_can(pTHXo_ CV *cv);
+void XS_UNIVERSAL_VERSION(pTHXo_ CV *cv);
+
+void
+Perl_boot_core_UNIVERSAL(pTHX)
+{
+    char *file = __FILE__;
+
+    newXS("UNIVERSAL::isa",             XS_UNIVERSAL_isa,         file);
+    newXS("UNIVERSAL::can",             XS_UNIVERSAL_can,         file);
+    newXS("UNIVERSAL::VERSION",        XS_UNIVERSAL_VERSION,     file);
+}
 
 #include "XSUB.h"
 
@@ -169,7 +179,7 @@ XS(XS_UNIVERSAL_VERSION)
     GV *gv;
     SV *sv;
     char *undef;
-    double req;
+    NV req;
 
     if(SvROK(ST(0))) {
         sv = (SV*)SvRV(ST(0));
@@ -183,7 +193,7 @@ XS(XS_UNIVERSAL_VERSION)
 
     gvp = pkg ? (GV**)hv_fetch(pkg,"VERSION",7,FALSE) : Null(GV**);
 
-    if (gvp && (gv = *gvp) != (GV*)&PL_sv_undef && (sv = GvSV(gv))) {
+    if (gvp && isGV(gv = *gvp) && SvOK(sv = GvSV(gv))) {
         SV *nsv = sv_newmortal();
         sv_setsv(nsv, sv);
         sv = nsv;
@@ -205,18 +215,3 @@ XS(XS_UNIVERSAL_VERSION)
     XSRETURN(1);
 }
 
-#ifdef PERL_OBJECT
-#undef  boot_core_UNIVERSAL
-#define boot_core_UNIVERSAL CPerlObj::Perl_boot_core_UNIVERSAL
-#define pPerl this
-#endif
-
-void
-Perl_boot_core_UNIVERSAL(pTHX)
-{
-    char *file = __FILE__;
-
-    newXS("UNIVERSAL::isa",             XS_UNIVERSAL_isa,         file);
-    newXS("UNIVERSAL::can",             XS_UNIVERSAL_can,         file);
-    newXS("UNIVERSAL::VERSION",        XS_UNIVERSAL_VERSION,     file);
-}