From: Zefram Date: Wed, 1 Feb 2012 19:59:05 +0000 (+0000) Subject: partially substitute for unexported symbols X-Git-Tag: 0.006009~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef91f92b23a85707ac98d40bb6b38e21ea2f35b4;p=p5sagit%2FDevel-Declare.git partially substitute for unexported symbols We use two interpreter variables on Perl 5.8 that are not exported on Windows. Can work around the lack of export on multiplicity/threading builds. --- diff --git a/Changes b/Changes index 3d42a19..73bbcc0 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,8 @@ Changes for Devel-Declare - Fix a C declaration after statement, which broke compatibility with older compilers (Jan Dubois). + - Partially work around unexported core symbols affecting Perl 5.8 on + Windows (David Bouyssie). - Jump through some hoops to avoid compiler warnings. 0.006008 - 05 Nov 2011 diff --git a/stolen_chunk_of_toke.c b/stolen_chunk_of_toke.c index cbc1806..3f576f2 100644 --- a/stolen_chunk_of_toke.c +++ b/stolen_chunk_of_toke.c @@ -108,6 +108,20 @@ STATIC char* S_scan_word(pTHX_ char *s, char *dest, STRLEN destlen, int allow #define PERL_5_9_PLUS #endif +#ifndef PERL_5_9_PLUS +/* These two are not exported from the core on Windows. With 5.9+ + it's not an issue, because they're part of the PL_parser structure, + which is exported. On multiplicity/thread builds we can work + around the lack of export by this formulation, where we provide + a substitute implementation of the unexported accessor functions. + On single-interpreter builds we can't, because access is directly + via symbols that are not exported. */ +# define Perl_Ilinestart_ptr my_Ilinestart_ptr +char **my_Ilinestart_ptr(pTHX) { return &(aTHX->Ilinestart); } +# define Perl_Isublex_info_ptr my_Isublex_info_ptr +static SUBLEXINFO *my_Isublex_info_ptr(pTHX) { return &(aTHX->Isublex_info); } +#endif + #ifdef PERL_5_9_PLUS /* 5.9+ moves a bunch of things to a PL_parser struct so we need to declare the backcompat macros for things to still work (mst) */