summaryrefslogtreecommitdiff
path: root/embedvar.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 /embedvar.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 'embedvar.h')
-rw-r--r--embedvar.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/embedvar.h b/embedvar.h
index 25c033c273..587bc94863 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -65,6 +65,7 @@
#define PL_Xpv (vTHX->IXpv)
#define PL_amagic_generation (vTHX->Iamagic_generation)
#define PL_an (vTHX->Ian)
+#define PL_apiversion (vTHX->Iapiversion)
#define PL_argvgv (vTHX->Iargvgv)
#define PL_argvout_stack (vTHX->Iargvout_stack)
#define PL_argvoutgv (vTHX->Iargvoutgv)
@@ -395,6 +396,7 @@
#define PL_IXpv PL_Xpv
#define PL_Iamagic_generation PL_amagic_generation
#define PL_Ian PL_an
+#define PL_Iapiversion PL_apiversion
#define PL_Iargvgv PL_argvgv
#define PL_Iargvout_stack PL_argvout_stack
#define PL_Iargvoutgv PL_argvoutgv