From: John Peacock Date: Wed, 18 Aug 2004 08:26:35 +0000 (-0400) Subject: The XSUB.h patch from: X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=639e8c3d11c6a0a342c9e54e4c5c8e139c387975;p=p5sagit%2Fp5-mst-13.2.git The XSUB.h patch from: Subject: CPAN Upload: J/JP/JPEACOCK/version-0.42.tar.gz Message-ID: <41234AFB.1020009@rowman.com> Now it will use version object logic for version comparison when loading XS modules. p4raw-id: //depot/perl@23323 --- diff --git a/XSUB.h b/XSUB.h index 4306454..c940d77 100644 --- a/XSUB.h +++ b/XSUB.h @@ -238,11 +238,17 @@ C. See L. _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \ vn = "VERSION"), FALSE); \ } \ - if (_sv && (!SvOK(_sv) || strNE(XS_VERSION, SvPV(_sv, n_a)))) \ - Perl_croak(aTHX_ "%s object version %s does not match %s%s%s%s %"SVf,\ - module, XS_VERSION, \ - vn ? "$" : "", vn ? module : "", vn ? "::" : "", \ - vn ? vn : "bootstrap parameter", _sv); \ + if (_sv) { \ + SV *xssv = Perl_newSVpvf(aTHX_ "%s",XS_VERSION); \ + xssv = new_version(xssv); \ + if ( !sv_derived_from(_sv, "version") ) \ + _sv = new_version(_sv); \ + if ( vcmp(_sv,xssv) ) \ + Perl_croak(aTHX_ "%s object version %_ does not match %s%s%s%s %_",\ + module, vstringify(xssv), \ + vn ? "$" : "", vn ? module : "", vn ? "::" : "", \ + vn ? vn : "bootstrap parameter", vstringify(_sv));\ + } \ } STMT_END #else # define XS_VERSION_BOOTCHECK