Skip to content

Commit 562b398

Browse files
committed
updated for version 7.4.117
Problem: Can't build with Cygwin/MingW and Perl 5.18. Solution: Add a linker argument for the Perl library. (Cesar Romani) Adjust CFLAGS and LIB. (Cesar Romani) Move including inline.h further down. (Ken Takata)
1 parent 4a27cc9 commit 562b398

File tree

4 files changed

+44
-15
lines changed

4 files changed

+44
-15
lines changed

src/Make_cyg.mak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Makefile for VIM on Win32, using Cygnus gcc
3-
# Last updated by Dan Sharp. Last Change: 2013 Nov 28
3+
# Last updated by Dan Sharp. Last Change: 2013 Dec 11
44
#
55
# Also read INSTALLpc.txt!
66
#
@@ -155,7 +155,7 @@ endif
155155
ifeq (yes, $(DYNAMIC_PERL))
156156
DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
157157
else
158-
EXTRA_LIBS += $(PERL)/lib/CORE/perl$(PERL_VER).lib
158+
EXTRA_LIBS += -L$(PERL)/lib/CORE -lperl$(PERL_VER)
159159
endif
160160
endif
161161

src/Make_ming.mak

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ WINDRES_CC = $(CC)
359359

360360
CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
361361
WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
362+
EXTRA_LIBS =
362363

363364
ifdef GETTEXT
364365
DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
@@ -377,9 +378,10 @@ endif
377378
endif
378379

379380
ifdef PERL
380-
CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -L$(PERLLIBS)
381+
CFLAGS += -I$(PERLLIBS) -DFEAT_PERL
381382
ifeq (yes, $(DYNAMIC_PERL))
382383
CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
384+
EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
383385
endif
384386
endif
385387

@@ -632,7 +634,7 @@ endif
632634

633635
ifdef PERL
634636
ifeq (no, $(DYNAMIC_PERL))
635-
LIB += -lperl$(PERL_VER)
637+
LIB += -L$(PERLLIBS) -lperl$(PERL_VER)
636638
endif
637639
endif
638640

src/if_perl.xs

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
#define IN_PERL_FILE /* don't include if_perl.pro from proto.h */
1515

1616
/*
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).
1819
* (http://community.activestate.com/faq/windows-compilers-perl-modules)
1920
* It means that time_t should be 32-bit. However the default size of
2021
* time_t is 64-bit since VC8. So we have to define _USE_32BIT_TIME_T.
@@ -23,6 +24,22 @@
2324
# define _USE_32BIT_TIME_T
2425
#endif
2526

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+
2643
#include "vim.h"
2744

2845
#include <EXTERN.h>
@@ -81,10 +98,6 @@
8198
# define PERL5101_OR_LATER
8299
#endif
83100

84-
#if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
85-
# define PERL5180_OR_LATER
86-
#endif
87-
88101
#ifndef pTHX
89102
# define pTHX void
90103
# define pTHX_
@@ -145,11 +158,9 @@ typedef int perl_key;
145158
# define perl_free dll_perl_free
146159
# define Perl_get_context dll_Perl_get_context
147160
# define Perl_croak dll_Perl_croak
148-
# ifndef PERL5180_OR_LATER
149161
# ifdef PERL5101_OR_LATER
150162
# define Perl_croak_xs_usage dll_Perl_croak_xs_usage
151163
# endif
152-
# endif
153164
# ifndef PROTO
154165
# define Perl_croak_nocontext dll_Perl_croak_nocontext
155166
# define Perl_call_argv dll_Perl_call_argv
@@ -262,10 +273,13 @@ static int (*perl_run)(PerlInterpreter*);
262273
static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
263274
static void* (*Perl_get_context)(void);
264275
static void (*Perl_croak)(pTHX_ const char*, ...);
265-
#ifndef PERL5180_OR_LATER
266276
#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
267281
static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params);
268-
#endif
282+
# endif
269283
#endif
270284
static void (*Perl_croak_nocontext)(const char*, ...);
271285
static I32 (*Perl_dowantarray)(pTHX);
@@ -337,7 +351,12 @@ static SV** (*Perl_TSv_ptr)(register PerlInterpreter*);
337351
static XPV** (*Perl_TXpv_ptr)(register PerlInterpreter*);
338352
static STRLEN* (*Perl_Tna_ptr)(register PerlInterpreter*);
339353
#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
340358
static void (*Perl_sv_free2)(pTHX_ SV*);
359+
# endif
341360
static void (*Perl_sys_init)(int* argc, char*** argv);
342361
static void (*Perl_sys_term)(void);
343362
static void (*Perl_call_list)(pTHX_ I32, AV*);
@@ -384,10 +403,8 @@ static struct {
384403
{"perl_parse", (PERL_PROC*)&perl_parse},
385404
{"Perl_get_context", (PERL_PROC*)&Perl_get_context},
386405
{"Perl_croak", (PERL_PROC*)&Perl_croak},
387-
#ifndef PERL5180_OR_LATER
388406
#ifdef PERL5101_OR_LATER
389407
{"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage},
390-
#endif
391408
#endif
392409
{"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext},
393410
{"Perl_dowantarray", (PERL_PROC*)&Perl_dowantarray},
@@ -492,6 +509,14 @@ static struct {
492509
{"", NULL},
493510
};
494511

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+
495520
/*
496521
* Make all runtime-links of perl.
497522
*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
117,
741743
/**/
742744
116,
743745
/**/

0 commit comments

Comments
 (0)