summaryrefslogtreecommitdiff
path: root/XSUB.h
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@rowman.com>2004-08-18 04:26:35 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-09-15 16:12:42 +0000
commit639e8c3d11c6a0a342c9e54e4c5c8e139c387975 (patch)
tree8dcb3fe8e9e96a59404526f92fed29477ea690f8 /XSUB.h
parent1fbb4de4c7fd798d63246750a9916fb1b938184e (diff)
downloadperl-639e8c3d11c6a0a342c9e54e4c5c8e139c387975.tar.gz
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
Diffstat (limited to 'XSUB.h')
-rw-r--r--XSUB.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/XSUB.h b/XSUB.h
index 43064548bf..c940d77845 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -238,11 +238,17 @@ C<xsubpp>. See L<perlxs/"The VERSIONCHECK: Keyword">.
_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