|
14 | 14 | #define IN_PERL_FILE /* don't include if_perl.pro from proto.h */ |
15 | 15 |
|
16 | 16 | /* |
17 | | - * Currently 32-bit version of ActivePerl is built with VC6. |
| 17 | + * Currently 32-bit version of ActivePerl is built with VC6 (or MinGW since |
| 18 | + * ActivePerl 5.18). |
18 | 19 | * (http://community.activestate.com/faq/windows-compilers-perl-modules) |
19 | 20 | * It means that time_t should be 32-bit. However the default size of |
20 | 21 | * time_t is 64-bit since VC8. So we have to define _USE_32BIT_TIME_T. |
|
23 | 24 | # define _USE_32BIT_TIME_T |
24 | 25 | #endif |
25 | 26 |
|
| 27 | +/* Work around for perl-5.18. |
| 28 | + * Don't include "perl\lib\CORE\inline.h" for now, |
| 29 | + * include it after Perl_sv_free2 is defined. */ |
| 30 | +#define PERL_NO_INLINE_FUNCTIONS |
| 31 | + |
| 32 | +/* |
| 33 | + * Prevent including winsock.h. perl.h tries to detect whether winsock.h is |
| 34 | + * already included before including winsock2.h, because winsock2.h isn't |
| 35 | + * compatible with winsock.h. However the detection doesn't work with some |
| 36 | + * versions of MinGW. If WIN32_LEAN_AND_MEAN is defined, windows.h will not |
| 37 | + * include winsock.h. |
| 38 | + */ |
| 39 | +#ifdef WIN32 |
| 40 | +# define WIN32_LEAN_AND_MEAN |
| 41 | +#endif |
| 42 | + |
26 | 43 | #include "vim.h" |
27 | 44 |
|
28 | 45 | #include <EXTERN.h> |
|
81 | 98 | # define PERL5101_OR_LATER |
82 | 99 | #endif |
83 | 100 |
|
84 | | -#if (PERL_REVISION == 5) && (PERL_VERSION >= 18) |
85 | | -# define PERL5180_OR_LATER |
86 | | -#endif |
87 | | - |
88 | 101 | #ifndef pTHX |
89 | 102 | # define pTHX void |
90 | 103 | # define pTHX_ |
@@ -145,11 +158,9 @@ typedef int perl_key; |
145 | 158 | # define perl_free dll_perl_free |
146 | 159 | # define Perl_get_context dll_Perl_get_context |
147 | 160 | # define Perl_croak dll_Perl_croak |
148 | | -# ifndef PERL5180_OR_LATER |
149 | 161 | # ifdef PERL5101_OR_LATER |
150 | 162 | # define Perl_croak_xs_usage dll_Perl_croak_xs_usage |
151 | 163 | # endif |
152 | | -# endif |
153 | 164 | # ifndef PROTO |
154 | 165 | # define Perl_croak_nocontext dll_Perl_croak_nocontext |
155 | 166 | # define Perl_call_argv dll_Perl_call_argv |
@@ -262,10 +273,13 @@ static int (*perl_run)(PerlInterpreter*); |
262 | 273 | static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**); |
263 | 274 | static void* (*Perl_get_context)(void); |
264 | 275 | static void (*Perl_croak)(pTHX_ const char*, ...); |
265 | | -#ifndef PERL5180_OR_LATER |
266 | 276 | #ifdef PERL5101_OR_LATER |
| 277 | +/* Perl-5.18 has a different Perl_croak_xs_usage signature. */ |
| 278 | +# if (PERL_REVISION == 5) && (PERL_VERSION >= 18) |
| 279 | +static void (*Perl_croak_xs_usage)(const CV *const, const char *const params); |
| 280 | +# else |
267 | 281 | static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params); |
268 | | -#endif |
| 282 | +# endif |
269 | 283 | #endif |
270 | 284 | static void (*Perl_croak_nocontext)(const char*, ...); |
271 | 285 | static I32 (*Perl_dowantarray)(pTHX); |
@@ -337,7 +351,12 @@ static SV** (*Perl_TSv_ptr)(register PerlInterpreter*); |
337 | 351 | static XPV** (*Perl_TXpv_ptr)(register PerlInterpreter*); |
338 | 352 | static STRLEN* (*Perl_Tna_ptr)(register PerlInterpreter*); |
339 | 353 | #else |
| 354 | +/* Perl-5.18 has a different Perl_sv_free2 signature. */ |
| 355 | +# if (PERL_REVISION == 5) && (PERL_VERSION >= 18) |
| 356 | +static void (*Perl_sv_free2)(pTHX_ SV*, const U32); |
| 357 | +# else |
340 | 358 | static void (*Perl_sv_free2)(pTHX_ SV*); |
| 359 | +# endif |
341 | 360 | static void (*Perl_sys_init)(int* argc, char*** argv); |
342 | 361 | static void (*Perl_sys_term)(void); |
343 | 362 | static void (*Perl_call_list)(pTHX_ I32, AV*); |
@@ -384,10 +403,8 @@ static struct { |
384 | 403 | {"perl_parse", (PERL_PROC*)&perl_parse}, |
385 | 404 | {"Perl_get_context", (PERL_PROC*)&Perl_get_context}, |
386 | 405 | {"Perl_croak", (PERL_PROC*)&Perl_croak}, |
387 | | -#ifndef PERL5180_OR_LATER |
388 | 406 | #ifdef PERL5101_OR_LATER |
389 | 407 | {"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage}, |
390 | | -#endif |
391 | 408 | #endif |
392 | 409 | {"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext}, |
393 | 410 | {"Perl_dowantarray", (PERL_PROC*)&Perl_dowantarray}, |
@@ -492,6 +509,14 @@ static struct { |
492 | 509 | {"", NULL}, |
493 | 510 | }; |
494 | 511 |
|
| 512 | +/* Work around for perl-5.18. |
| 513 | + * The definitions of S_SvREFCNT_inc and S_SvREFCNT_dec are needed, so include |
| 514 | + * "perl\lib\CORE\inline.h", after Perl_sv_free2 is defined. |
| 515 | + * The linker won't complain about undefined __impl_Perl_sv_free2. */ |
| 516 | +#if (PERL_REVISION == 5) && (PERL_VERSION >= 18) |
| 517 | +# include <inline.h> |
| 518 | +#endif |
| 519 | + |
495 | 520 | /* |
496 | 521 | * Make all runtime-links of perl. |
497 | 522 | * |
|
0 commit comments