summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--XSUB.h2
-rw-r--r--embed.fnc2
-rw-r--r--pod/perlclib.pod3
-rw-r--r--pod/perldiag.pod5
-rw-r--r--proto.h6
-rw-r--r--util.c30
6 files changed, 19 insertions, 29 deletions
diff --git a/XSUB.h b/XSUB.h
index d0fb253277..004a0d678b 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -331,7 +331,7 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
#endif
#define XS_APIVERSION_BOOTCHECK \
- Perl_xs_apiversion_bootcheck(aTHX_ ST(0), STR_WITH_LEN("v" PERL_API_VERSION_STRING))
+ Perl_xs_apiversion_bootcheck(ST(0), STR_WITH_LEN("v" PERL_API_VERSION_STRING))
#ifdef NO_XSLOCKS
# define dXCPT dJMPENV; int rEtV = 0
diff --git a/embed.fnc b/embed.fnc
index 78ad3d8094..3b43acd0d1 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2697,7 +2697,7 @@ Xpo |void |xs_version_bootcheck|U32 items|U32 ax|NN const char *xs_p \
|STRLEN xs_len
: This function is an implementation detail. The public API for this is
: XS_APIVERSION_BOOTCHECK
-Xpo |void |xs_apiversion_bootcheck|NN SV *module|NN const char *api_p \
+Xpon |void |xs_apiversion_bootcheck|NN SV *module|NN const char *api_p \
|STRLEN api_len
#ifndef HAS_STRLCAT
diff --git a/pod/perlclib.pod b/pod/perlclib.pod
index 7f86f1b54e..03dce25665 100644
--- a/pod/perlclib.pod
+++ b/pod/perlclib.pod
@@ -119,6 +119,9 @@ There is no equivalent to C<fgets>; one should use C<sv_gets> instead:
/ strGT(s1,s2)
strncmp(s1, s2, n) strnNE(s1, s2, n) / strnEQ(s1, s2, n)
+ memcmp(p1, p2, n) memNE(p1, p2, n)
+ !memcmp(p1, p2, n) memEQ(p1, p2, n)
+
Notice the different order of arguments to C<Copy> and C<Move> than used
in C<memcpy> and C<memmove>.
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 262d04bd65..df15a176bf 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -4349,6 +4349,11 @@ is equivalent to v5.100.
recent than the currently running version. How long has it been since
you upgraded, anyway? See L<perlfunc/require>.
+=item Perl API version %s of %s does not match %s
+
+(F) The XS module in question was complied against a different incompatible
+version of Perl than the one that has loaded the XS module.
+
=item PERL_SH_DIR too long
(F) An error peculiar to OS/2. PERL_SH_DIR is the directory to find the
diff --git a/proto.h b/proto.h
index 67415639b4..95ad1beec9 100644
--- a/proto.h
+++ b/proto.h
@@ -5153,9 +5153,9 @@ PERL_CALLCONV void Perl_write_to_stderr(pTHX_ SV* msv)
#define PERL_ARGS_ASSERT_WRITE_TO_STDERR \
assert(msv)
-PERL_CALLCONV void Perl_xs_apiversion_bootcheck(pTHX_ SV *module, const char *api_p, STRLEN api_len)
- __attribute__nonnull__(pTHX_1)
- __attribute__nonnull__(pTHX_2);
+PERL_CALLCONV void Perl_xs_apiversion_bootcheck(SV *module, const char *api_p, STRLEN api_len)
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
#define PERL_ARGS_ASSERT_XS_APIVERSION_BOOTCHECK \
assert(module); assert(api_p)
diff --git a/util.c b/util.c
index eadd21de87..d12ac8895d 100644
--- a/util.c
+++ b/util.c
@@ -5380,34 +5380,16 @@ Perl_xs_version_bootcheck(pTHX_ U32 items, U32 ax, const char *xs_p,
}
void
-Perl_xs_apiversion_bootcheck(pTHX_ SV *module, const char *api_p,
+Perl_xs_apiversion_bootcheck(SV *module, const char *api_p,
STRLEN api_len)
{
- SV *xpt = NULL;
- SV *compver = Perl_newSVpvn_flags(aTHX_ api_p, api_len, SVs_TEMP);
- SV *runver;
-
PERL_ARGS_ASSERT_XS_APIVERSION_BOOTCHECK;
- /* This might croak */
- compver = upg_version(compver, 0);
- /* This should never croak */
- runver = new_version(PL_apiversion);
- if (vcmp(compver, runver)) {
- SV *compver_string = vstringify(compver);
- SV *runver_string = vstringify(runver);
- xpt = Perl_newSVpvf(aTHX_ "Perl API version %"SVf
- " of %"SVf" does not match %"SVf,
- SVfARG(compver_string), SVfARG(module),
- SVfARG(runver_string));
- Perl_sv_2mortal(aTHX_ xpt);
-
- SvREFCNT_dec(compver_string);
- SvREFCNT_dec(runver_string);
- }
- SvREFCNT_dec(runver);
- if (xpt)
- Perl_croak_sv(aTHX_ xpt);
+ if(api_len != sizeof("v" PERL_API_VERSION_STRING)-1
+ || memNE(api_p, "v" PERL_API_VERSION_STRING, sizeof("v" PERL_API_VERSION_STRING)-1)) {
+ Perl_croak_nocontext("Perl API version %s of %"SVf" does not match %s",
+ api_p, SVfARG(module), "v" PERL_API_VERSION_STRING);
+ }
}
/*