summaryrefslogtreecommitdiff
path: root/perl.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 /perl.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 'perl.h')
-rw-r--r--perl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 32cf7873e1..59df0aaba7 100644
--- a/perl.h
+++ b/perl.h
@@ -4900,6 +4900,10 @@ typedef struct exitlistentry {
STRINGIFY(PERL_VERSION) "." \
STRINGIFY(PERL_SUBVERSION)
+#define PERL_API_VERSION_STRING STRINGIFY(PERL_API_REVISION) "." \
+ STRINGIFY(PERL_API_VERSION) "." \
+ STRINGIFY(PERL_API_SUBVERSION)
+
#ifdef PERL_GLOBAL_STRUCT
struct perl_vars {
# include "perlvars.h"