8b9a1c
To: vim_dev@googlegroups.com
8b9a1c
Subject: Patch 7.4.117
8b9a1c
Fcc: outbox
8b9a1c
From: Bram Moolenaar <Bram@moolenaar.net>
8b9a1c
Mime-Version: 1.0
8b9a1c
Content-Type: text/plain; charset=UTF-8
8b9a1c
Content-Transfer-Encoding: 8bit
8b9a1c
------------
8b9a1c
8b9a1c
Patch 7.4.117
8b9a1c
Problem:    Can't build with Cygwin/MingW and Perl 5.18.
8b9a1c
Solution:   Add a linker argument for the Perl library. (Cesar Romani)
8b9a1c
	    Adjust CFLAGS and LIB. (Cesar Romani)
8b9a1c
	    Move including inline.h further down. (Ken Takata)
8b9a1c
Files:	    src/Make_cyg.mak, src/Make_ming.mak, src/if_perl.xs
8b9a1c
8b9a1c
8b9a1c
*** ../vim-7.4.116/src/Make_cyg.mak	2013-11-28 16:32:34.000000000 +0100
8b9a1c
--- src/Make_cyg.mak	2013-12-11 14:59:12.000000000 +0100
8b9a1c
***************
8b9a1c
*** 1,6 ****
8b9a1c
  #
8b9a1c
  # Makefile for VIM on Win32, using Cygnus gcc
8b9a1c
! # Last updated by Dan Sharp.  Last Change: 2013 Nov 28
8b9a1c
  #
8b9a1c
  # Also read INSTALLpc.txt!
8b9a1c
  #
8b9a1c
--- 1,6 ----
8b9a1c
  #
8b9a1c
  # Makefile for VIM on Win32, using Cygnus gcc
8b9a1c
! # Last updated by Dan Sharp.  Last Change: 2013 Dec 11
8b9a1c
  #
8b9a1c
  # Also read INSTALLpc.txt!
8b9a1c
  #
8b9a1c
***************
8b9a1c
*** 155,161 ****
8b9a1c
  ifeq (yes, $(DYNAMIC_PERL))
8b9a1c
  DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
8b9a1c
  else
8b9a1c
! EXTRA_LIBS += $(PERL)/lib/CORE/perl$(PERL_VER).lib
8b9a1c
  endif
8b9a1c
  endif
8b9a1c
  
8b9a1c
--- 155,161 ----
8b9a1c
  ifeq (yes, $(DYNAMIC_PERL))
8b9a1c
  DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
8b9a1c
  else
8b9a1c
! EXTRA_LIBS += -L$(PERL)/lib/CORE -lperl$(PERL_VER)
8b9a1c
  endif
8b9a1c
  endif
8b9a1c
  
8b9a1c
*** ../vim-7.4.116/src/Make_ming.mak	2013-07-06 13:32:11.000000000 +0200
8b9a1c
--- src/Make_ming.mak	2013-12-07 20:02:52.000000000 +0100
8b9a1c
***************
8b9a1c
*** 359,364 ****
8b9a1c
--- 359,365 ----
8b9a1c
  
8b9a1c
  CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
8b9a1c
  WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
8b9a1c
+ EXTRA_LIBS =
8b9a1c
  
8b9a1c
  ifdef GETTEXT
8b9a1c
  DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
8b9a1c
***************
8b9a1c
*** 377,385 ****
8b9a1c
  endif
8b9a1c
  
8b9a1c
  ifdef PERL
8b9a1c
! CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -L$(PERLLIBS)
8b9a1c
  ifeq (yes, $(DYNAMIC_PERL))
8b9a1c
  CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
8b9a1c
  endif
8b9a1c
  endif
8b9a1c
  
8b9a1c
--- 378,387 ----
8b9a1c
  endif
8b9a1c
  
8b9a1c
  ifdef PERL
8b9a1c
! CFLAGS += -I$(PERLLIBS) -DFEAT_PERL
8b9a1c
  ifeq (yes, $(DYNAMIC_PERL))
8b9a1c
  CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
8b9a1c
+ EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
8b9a1c
  endif
8b9a1c
  endif
8b9a1c
  
8b9a1c
***************
8b9a1c
*** 632,638 ****
8b9a1c
  
8b9a1c
  ifdef PERL
8b9a1c
  ifeq (no, $(DYNAMIC_PERL))
8b9a1c
! LIB += -lperl$(PERL_VER)
8b9a1c
  endif
8b9a1c
  endif
8b9a1c
  
8b9a1c
--- 634,640 ----
8b9a1c
  
8b9a1c
  ifdef PERL
8b9a1c
  ifeq (no, $(DYNAMIC_PERL))
8b9a1c
! LIB += -L$(PERLLIBS) -lperl$(PERL_VER)
8b9a1c
  endif
8b9a1c
  endif
8b9a1c
  
8b9a1c
*** ../vim-7.4.116/src/if_perl.xs	2013-08-02 19:28:50.000000000 +0200
8b9a1c
--- src/if_perl.xs	2013-12-11 15:02:58.000000000 +0100
8b9a1c
***************
8b9a1c
*** 14,20 ****
8b9a1c
  #define IN_PERL_FILE	/* don't include if_perl.pro from proto.h */
8b9a1c
  
8b9a1c
  /*
8b9a1c
!  * Currently 32-bit version of ActivePerl is built with VC6.
8b9a1c
   * (http://community.activestate.com/faq/windows-compilers-perl-modules)
8b9a1c
   * It means that time_t should be 32-bit. However the default size of
8b9a1c
   * time_t is 64-bit since VC8. So we have to define _USE_32BIT_TIME_T.
8b9a1c
--- 14,21 ----
8b9a1c
  #define IN_PERL_FILE	/* don't include if_perl.pro from proto.h */
8b9a1c
  
8b9a1c
  /*
8b9a1c
!  * Currently 32-bit version of ActivePerl is built with VC6 (or MinGW since
8b9a1c
!  * ActivePerl 5.18).
8b9a1c
   * (http://community.activestate.com/faq/windows-compilers-perl-modules)
8b9a1c
   * It means that time_t should be 32-bit. However the default size of
8b9a1c
   * time_t is 64-bit since VC8. So we have to define _USE_32BIT_TIME_T.
8b9a1c
***************
8b9a1c
*** 23,28 ****
8b9a1c
--- 24,45 ----
8b9a1c
  # define _USE_32BIT_TIME_T
8b9a1c
  #endif
8b9a1c
  
8b9a1c
+ /* Work around for perl-5.18.
8b9a1c
+  * Don't include "perl\lib\CORE\inline.h" for now,
8b9a1c
+  * include it after Perl_sv_free2 is defined. */
8b9a1c
+ #define PERL_NO_INLINE_FUNCTIONS
8b9a1c
+ 
8b9a1c
+ /*
8b9a1c
+  * Prevent including winsock.h.  perl.h tries to detect whether winsock.h is
8b9a1c
+  * already included before including winsock2.h, because winsock2.h isn't
8b9a1c
+  * compatible with winsock.h.  However the detection doesn't work with some
8b9a1c
+  * versions of MinGW.  If WIN32_LEAN_AND_MEAN is defined, windows.h will not
8b9a1c
+  * include winsock.h.
8b9a1c
+  */
8b9a1c
+ #ifdef WIN32
8b9a1c
+ # define WIN32_LEAN_AND_MEAN
8b9a1c
+ #endif
8b9a1c
+ 
8b9a1c
  #include "vim.h"
8b9a1c
  
8b9a1c
  #include <EXTERN.h>
8b9a1c
***************
8b9a1c
*** 81,90 ****
8b9a1c
  # define PERL5101_OR_LATER
8b9a1c
  #endif
8b9a1c
  
8b9a1c
- #if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
8b9a1c
- # define PERL5180_OR_LATER
8b9a1c
- #endif
8b9a1c
- 
8b9a1c
  #ifndef pTHX
8b9a1c
  #    define pTHX void
8b9a1c
  #    define pTHX_
8b9a1c
--- 98,103 ----
8b9a1c
***************
8b9a1c
*** 145,155 ****
8b9a1c
  # define perl_free dll_perl_free
8b9a1c
  # define Perl_get_context dll_Perl_get_context
8b9a1c
  # define Perl_croak dll_Perl_croak
8b9a1c
- # ifndef PERL5180_OR_LATER
8b9a1c
  # ifdef PERL5101_OR_LATER
8b9a1c
  #  define Perl_croak_xs_usage dll_Perl_croak_xs_usage
8b9a1c
  # endif
8b9a1c
- # endif
8b9a1c
  # ifndef PROTO
8b9a1c
  #  define Perl_croak_nocontext dll_Perl_croak_nocontext
8b9a1c
  #  define Perl_call_argv dll_Perl_call_argv
8b9a1c
--- 158,166 ----
8b9a1c
***************
8b9a1c
*** 262,271 ****
8b9a1c
  static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
8b9a1c
  static void* (*Perl_get_context)(void);
8b9a1c
  static void (*Perl_croak)(pTHX_ const char*, ...);
8b9a1c
- #ifndef PERL5180_OR_LATER
8b9a1c
  #ifdef PERL5101_OR_LATER
8b9a1c
  static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params);
8b9a1c
! #endif
8b9a1c
  #endif
8b9a1c
  static void (*Perl_croak_nocontext)(const char*, ...);
8b9a1c
  static I32 (*Perl_dowantarray)(pTHX);
8b9a1c
--- 273,285 ----
8b9a1c
  static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
8b9a1c
  static void* (*Perl_get_context)(void);
8b9a1c
  static void (*Perl_croak)(pTHX_ const char*, ...);
8b9a1c
  #ifdef PERL5101_OR_LATER
8b9a1c
+ /* Perl-5.18 has a different Perl_croak_xs_usage signature. */
8b9a1c
+ # if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
8b9a1c
+ static void (*Perl_croak_xs_usage)(const CV *const, const char *const params);
8b9a1c
+ # else
8b9a1c
  static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params);
8b9a1c
! # endif
8b9a1c
  #endif
8b9a1c
  static void (*Perl_croak_nocontext)(const char*, ...);
8b9a1c
  static I32 (*Perl_dowantarray)(pTHX);
8b9a1c
***************
8b9a1c
*** 337,343 ****
8b9a1c
--- 351,362 ----
8b9a1c
  static XPV** (*Perl_TXpv_ptr)(register PerlInterpreter*);
8b9a1c
  static STRLEN* (*Perl_Tna_ptr)(register PerlInterpreter*);
8b9a1c
  #else
8b9a1c
+ /* Perl-5.18 has a different Perl_sv_free2 signature. */
8b9a1c
+ # if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
8b9a1c
+ static void (*Perl_sv_free2)(pTHX_ SV*, const U32);
8b9a1c
+ # else
8b9a1c
  static void (*Perl_sv_free2)(pTHX_ SV*);
8b9a1c
+ # endif
8b9a1c
  static void (*Perl_sys_init)(int* argc, char*** argv);
8b9a1c
  static void (*Perl_sys_term)(void);
8b9a1c
  static void (*Perl_call_list)(pTHX_ I32, AV*);
8b9a1c
***************
8b9a1c
*** 384,394 ****
8b9a1c
      {"perl_parse", (PERL_PROC*)&perl_parse},
8b9a1c
      {"Perl_get_context", (PERL_PROC*)&Perl_get_context},
8b9a1c
      {"Perl_croak", (PERL_PROC*)&Perl_croak},
8b9a1c
- #ifndef PERL5180_OR_LATER
8b9a1c
  #ifdef PERL5101_OR_LATER
8b9a1c
      {"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage},
8b9a1c
  #endif
8b9a1c
- #endif
8b9a1c
      {"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext},
8b9a1c
      {"Perl_dowantarray", (PERL_PROC*)&Perl_dowantarray},
8b9a1c
      {"Perl_free_tmps", (PERL_PROC*)&Perl_free_tmps},
8b9a1c
--- 403,411 ----
8b9a1c
***************
8b9a1c
*** 492,497 ****
8b9a1c
--- 509,522 ----
8b9a1c
      {"", NULL},
8b9a1c
  };
8b9a1c
  
8b9a1c
+ /* Work around for perl-5.18.
8b9a1c
+  * The definitions of S_SvREFCNT_inc and S_SvREFCNT_dec are needed, so include
8b9a1c
+  * "perl\lib\CORE\inline.h", after Perl_sv_free2 is defined.
8b9a1c
+  * The linker won't complain about undefined __impl_Perl_sv_free2. */
8b9a1c
+ #if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
8b9a1c
+ # include <inline.h>
8b9a1c
+ #endif
8b9a1c
+ 
8b9a1c
  /*
8b9a1c
   * Make all runtime-links of perl.
8b9a1c
   *
8b9a1c
*** ../vim-7.4.116/src/version.c	2013-12-11 14:54:58.000000000 +0100
8b9a1c
--- src/version.c	2013-12-11 15:00:12.000000000 +0100
8b9a1c
***************
8b9a1c
*** 740,741 ****
8b9a1c
--- 740,743 ----
8b9a1c
  {   /* Add new patch number below this line */
8b9a1c
+ /**/
8b9a1c
+     117,
8b9a1c
  /**/
8b9a1c
8b9a1c
-- 
8b9a1c
Despite the cost of living, have you noticed how it remains so popular?
8b9a1c
8b9a1c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8b9a1c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8b9a1c
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
8b9a1c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///