summaryrefslogtreecommitdiff
path: root/perlapi.h
diff options
context:
space:
mode:
authorFlorian Ragwitz <rafl@debian.org>2010-07-20 22:58:24 +0200
committerFlorian Ragwitz <rafl@debian.org>2010-07-26 15:48:18 +0200
commit1e8125c621275d18c74bc8dae3bfc3c03929fe1e (patch)
tree787df37aad96d973175f1218677b312e8c8f261e /perlapi.h
parent3b462feda21356499e651643c80692cc1c5e6787 (diff)
downloadperl-1e8125c621275d18c74bc8dae3bfc3c03929fe1e.tar.gz
Check API compatibility when loading xs modules
This adds PL_apiversion, allowing the API version of a running interpreter to be introspected. It is used in the new XS_APIVERSION_BOOTCHECK macro, which is added to the _boot function of every XS module, to compare it against the API version the module has been compiled against. If the versions do not match, an exception is thrown. This doesn't fully prevent binary incompatible extensions to be loaded. It merely compares PERL_API_* between compile- and runtime, and does not attempt to solve the problem of identifying binary incompatible perls with the same API version (i.e. the same perl version configured with and without DEBUGGING).
Diffstat (limited to 'perlapi.h')
-rw-r--r--perlapi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/perlapi.h b/perlapi.h
index 742bb3a586..869d5123d7 100644
--- a/perlapi.h
+++ b/perlapi.h
@@ -166,6 +166,8 @@ END_EXTERN_C
#define PL_amagic_generation (*Perl_Iamagic_generation_ptr(aTHX))
#undef PL_an
#define PL_an (*Perl_Ian_ptr(aTHX))
+#undef PL_apiversion
+#define PL_apiversion (*Perl_Iapiversion_ptr(aTHX))
#undef PL_argvgv
#define PL_argvgv (*Perl_Iargvgv_ptr(aTHX))
#undef PL_argvout_stack