Lines 131-136
Link Here
|
131 |
#define PERL5101_OR_LATER |
131 |
#define PERL5101_OR_LATER |
132 |
#endif |
132 |
#endif |
133 |
|
133 |
|
|
|
134 |
// check if we're building with Perl 5.14 or later |
135 |
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14) |
136 |
#define PERL514_OR_LATER |
137 |
#endif |
138 |
|
139 |
// Check if PL_thr_key is a real variable or instead a macro which calls |
140 |
// Perl_Gthr_key_ptr(NULL), which was the default before Perl 5.14: |
141 |
#ifdef PL_thr_key |
142 |
#define PERL_THR_KEY_FUNC 1 |
143 |
#endif |
144 |
|
134 |
static PerlInterpreter* my_perl = NULL; |
145 |
static PerlInterpreter* my_perl = NULL; |
135 |
|
146 |
|
136 |
EXTERN_C void boot_DynaLoader(pTHX_ CV* cv); |
147 |
EXTERN_C void boot_DynaLoader(pTHX_ CV* cv); |
Lines 155-161
Link Here
|
155 |
extern "C" |
166 |
extern "C" |
156 |
{ |
167 |
{ |
157 |
#ifdef USE_ITHREADS |
168 |
#ifdef USE_ITHREADS |
158 |
perl_key*(*G_Perl_Gthr_key_ptr)(register PerlInterpreter*); |
169 |
#ifdef PERL_THR_KEY_FUNC |
|
|
170 |
perl_key*(*G_Perl_Gthr_key_ptr)(register PerlInterpreter*); |
171 |
#else |
172 |
perl_key *G_PL_thr_key; |
173 |
#endif |
159 |
#endif |
174 |
#endif |
160 |
SV**(*G_Perl_av_fetch)(pTHX_ AV*, I32, I32); |
175 |
SV**(*G_Perl_av_fetch)(pTHX_ AV*, I32, I32); |
161 |
I32(*G_Perl_av_len)(pTHX_ AV*); |
176 |
I32(*G_Perl_av_len)(pTHX_ AV*); |
Lines 215-221
Link Here
|
215 |
} |
230 |
} |
216 |
|
231 |
|
217 |
// redefine Perl functions to their equivalent G_* wrappers |
232 |
// redefine Perl functions to their equivalent G_* wrappers |
218 |
#define Perl_Gthr_key_ptr G_Perl_Gthr_key_ptr |
233 |
#ifdef USE_ITHREADS |
|
|
234 |
#ifdef PERL_THR_KEY_FUNC |
235 |
#define Perl_Gthr_key_ptr G_Perl_Gthr_key_ptr |
236 |
#else |
237 |
#define PL_thr_key (*G_PL_thr_key) |
238 |
#endif |
239 |
#endif |
219 |
#define Perl_av_fetch G_Perl_av_fetch |
240 |
#define Perl_av_fetch G_Perl_av_fetch |
220 |
#define Perl_av_len G_Perl_av_len |
241 |
#define Perl_av_len G_Perl_av_len |
221 |
#define Perl_av_push G_Perl_av_push |
242 |
#define Perl_av_push G_Perl_av_push |
Lines 287-293
Link Here
|
287 |
} perlFuncs[] = |
308 |
} perlFuncs[] = |
288 |
{ |
309 |
{ |
289 |
#ifdef USE_ITHREADS |
310 |
#ifdef USE_ITHREADS |
290 |
PERL_FUNC(Perl_Gthr_key_ptr) |
311 |
#ifdef PERL_THR_KEY_FUNC |
|
|
312 |
PERL_FUNC(Perl_Gthr_key_ptr) |
313 |
#else |
314 |
PERL_FUNC(PL_thr_key) |
315 |
#endif |
291 |
#endif |
316 |
#endif |
292 |
PERL_FUNC(Perl_av_fetch) |
317 |
PERL_FUNC(Perl_av_fetch) |
293 |
PERL_FUNC(Perl_av_len) |
318 |
PERL_FUNC(Perl_av_len) |
Lines 318-336
Link Here
|
318 |
PERL_FUNC(Perl_sys_term) |
343 |
PERL_FUNC(Perl_sys_term) |
319 |
#endif |
344 |
#endif |
320 |
#ifdef MULTIPLICITY |
345 |
#ifdef MULTIPLICITY |
321 |
#ifdef PERL510_OR_LATER |
346 |
#ifndef PERL514_OR_LATER |
322 |
PERL_FUNC(Perl_Imarkstack_ptr_ptr) |
347 |
// before Perl 5.14: |
323 |
PERL_FUNC(Perl_Istack_base_ptr) |
348 |
PERL_FUNC(Perl_Iexit_flags_ptr) |
324 |
PERL_FUNC(Perl_Istack_max_ptr) |
349 |
PERL_FUNC(Perl_Iperl_destruct_level_ptr) |
325 |
PERL_FUNC(Perl_Istack_sp_ptr) |
350 |
#ifdef PERL510_OR_LATER |
326 |
#else |
351 |
// Perl 5.10/5.12 only: |
327 |
PERL_FUNC(Perl_Tmarkstack_ptr_ptr) |
352 |
PERL_FUNC(Perl_Imarkstack_ptr_ptr) |
328 |
PERL_FUNC(Perl_Tstack_base_ptr) |
353 |
PERL_FUNC(Perl_Istack_base_ptr) |
329 |
PERL_FUNC(Perl_Tstack_max_ptr) |
354 |
PERL_FUNC(Perl_Istack_max_ptr) |
330 |
PERL_FUNC(Perl_Tstack_sp_ptr) |
355 |
PERL_FUNC(Perl_Istack_sp_ptr) |
|
|
356 |
#else |
357 |
// before Perl 5.10: |
358 |
PERL_FUNC(Perl_Tmarkstack_ptr_ptr) |
359 |
PERL_FUNC(Perl_Tstack_base_ptr) |
360 |
PERL_FUNC(Perl_Tstack_max_ptr) |
361 |
PERL_FUNC(Perl_Tstack_sp_ptr) |
362 |
#endif |
331 |
#endif |
363 |
#endif |
332 |
PERL_FUNC(Perl_Iexit_flags_ptr) |
|
|
333 |
PERL_FUNC(Perl_Iperl_destruct_level_ptr) |
334 |
#else /* no MULTIPLICITY */ |
364 |
#else /* no MULTIPLICITY */ |
335 |
/* N.B. these are actually variables, not functions, but the distinction does |
365 |
/* N.B. these are actually variables, not functions, but the distinction does |
336 |
not matter for symbol resolution: */ |
366 |
not matter for symbol resolution: */ |
Lines 3079-3086
Link Here
|
3079 |
STRLEN n_a; |
3109 |
STRLEN n_a; |
3080 |
char* err = SvPV(ST(0),n_a); |
3110 |
char* err = SvPV(ST(0),n_a); |
3081 |
|
3111 |
|
3082 |
// store message in global string (shown after script finishes) |
3112 |
if (scripterr == wxString(abortmsg,wxConvLocal)) { |
3083 |
scripterr = wxString(err, wxConvLocal); |
3113 |
// this can happen in Perl 5.14 so don't change scripterr |
|
|
3114 |
// otherwise a message box will appear |
3115 |
} else { |
3116 |
// store message in global string (shown after script finishes) |
3117 |
scripterr = wxString(err, wxConvLocal); |
3118 |
} |
3084 |
|
3119 |
|
3085 |
XSRETURN(0); |
3120 |
XSRETURN(0); |
3086 |
} |
3121 |
} |