Hi,

2013/12/5 Thu 10:50:55 UTC+9 Cesar wrote:
> The only command I've used with the above patched makefile, was:
> make -f Make_cyg.mak
> 
> but I used StrawberryPerl-5.18.1.1-32bit and ActivePerl-5.18.1.1-32bit,
> built on Windows 7 Home Premium 64-bit using cygwin 1.7.20 with gcc
> 4.5.3.

Maybe the Win32 API headers are different.
The latest MinGW versions installed with Cygwin are:
  i686-pc-mingw32-gcc (Non-w64 MinGW): 4.7.3
  i686-w64-mingw32-gcc (MinGW-w64): 4.8.2

Actually, the compilation error related to winsock.h is caused by the
difference of the include guard of each winsock.h:
  /usr/i686-pc-mingw32/sys-root/mingw/include/winsock.h: _WINSOCK_H
  /usr/i686-w64-mingw32/sys-root/mingw/include/winsock.h: _WINSOCKAPI_
ActivePerl's socket.h supports only _WINSOCKAPI_.

The compilation error also occurs with ActivePerl 5.16. (not only 5.18)
Now I found a fix for this problem without patching socket.h.
See fix-if_perl-mingw-winsock.patch.

As I already mentioned, Cesar's patches don't care about MSVC at all.
I don't think it's the right solution.
My conclusion is applying the following patches:

1. Apply fix-if_perl-mingw-winsock.patch.
2. Apply support-perl5.18-2.patch based on Gauchyler's patch.
   (Updated to fix conflict with fix-if_perl-mingw-winsock.patch.)
3. Apply fix-indent-in-if_perl.patch from
   https://groups.google.com/d/msg/vim_dev/YWnfI9wFFoA/UGznr8xgysEJ (optional).
4. Apply a patch for C:\Perl\lib\CORE\config.h from
   https://groups.google.com/d/msg/vim_dev/YWnfI9wFFoA/rZdp5k1hdeAJ ,
   if you use MSVC and ActivePerl 5.18 (and you don't want to build Perl
   form the source code).

This should work for all combinations of MSVC or MinGW (w64 or non-w64),
Perl 5.16 or 5.18, 32 or 64 bits, dynamic or static link.

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
# HG changeset patch
# Parent 486655e0c5a21469364d3cf895535137f09b3724

diff --git a/src/if_perl.xs b/src/if_perl.xs
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -23,6 +23,17 @@
 # define _USE_32BIT_TIME_T
 #endif
 
+/*
+ * Prevent including winsock.h.  perl.h tries to detect whether winsock.h is
+ * already included before including winsock2.h, because winsock2.h isn't
+ * compatible with winsock.h.  However the detection doesn't work with some
+ * versions of MinGW.  If WIN32_LEAN_AND_MEAN is defined, windows.h will not
+ * include winsock.h.
+ */
+#ifdef WIN32
+# define WIN32_LEAN_AND_MEAN
+#endif
+
 #include "vim.h"
 
 #include <EXTERN.h>
# HG changeset patch
# Parent a6d22413d40e92c88b23ed7bdd7254eaeeeb4096

diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -160,7 +160,7 @@
 ifeq (yes, $(DYNAMIC_PERL))
 DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
 else
-EXTRA_LIBS += $(PERL)/lib/CORE/perl$(PERL_VER).lib
+EXTRA_LIBS += -L $(PERL)/lib/CORE -lperl$(PERL_VER)
 endif
 endif
 
diff --git a/src/if_perl.xs b/src/if_perl.xs
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -14,7 +14,8 @@
 #define IN_PERL_FILE	/* don't include if_perl.pro from proto.h */
 
 /*
- * Currently 32-bit version of ActivePerl is built with VC6.
+ * Currently 32-bit version of ActivePerl is built with VC6 (or MinGW since
+ * ActivePerl 5.18).
  * (http://community.activestate.com/faq/windows-compilers-perl-modules)
  * It means that time_t should be 32-bit. However the default size of
  * time_t is 64-bit since VC8. So we have to define _USE_32BIT_TIME_T.
@@ -34,6 +35,11 @@
 # define WIN32_LEAN_AND_MEAN
 #endif
 
+/* Work around for perl-5.18.
+ * Don't include "perl\lib\CORE\inline.h" for now,
+ * include it after Perl_sv_free2 is defined. */
+#define PERL_NO_INLINE_FUNCTIONS
+
 #include "vim.h"
 
 #include <EXTERN.h>
@@ -92,10 +98,6 @@
 # define PERL5101_OR_LATER
 #endif
 
-#if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
-# define PERL5180_OR_LATER
-#endif
-
 #ifndef pTHX
 #    define pTHX void
 #    define pTHX_
@@ -156,11 +158,9 @@
 # define perl_free dll_perl_free
 # define Perl_get_context dll_Perl_get_context
 # define Perl_croak dll_Perl_croak
-# ifndef PERL5180_OR_LATER
 # ifdef PERL5101_OR_LATER
 #  define Perl_croak_xs_usage dll_Perl_croak_xs_usage
 # endif
-# endif
 # ifndef PROTO
 #  define Perl_croak_nocontext dll_Perl_croak_nocontext
 #  define Perl_call_argv dll_Perl_call_argv
@@ -273,10 +273,13 @@
 static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
 static void* (*Perl_get_context)(void);
 static void (*Perl_croak)(pTHX_ const char*, ...);
-#ifndef PERL5180_OR_LATER
 #ifdef PERL5101_OR_LATER
+/* Perl-5.18 has a different Perl_croak_xs_usage signature. */
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
+static void (*Perl_croak_xs_usage)(const CV *const, const char *const params);
+# else
 static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params);
-#endif
+# endif
 #endif
 static void (*Perl_croak_nocontext)(const char*, ...);
 static I32 (*Perl_dowantarray)(pTHX);
@@ -348,7 +351,12 @@
 static XPV** (*Perl_TXpv_ptr)(register PerlInterpreter*);
 static STRLEN* (*Perl_Tna_ptr)(register PerlInterpreter*);
 #else
+/* Perl-5.18 has a different Perl_sv_free2 signature. */
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
+static void (*Perl_sv_free2)(pTHX_ SV*, const U32);
+# else
 static void (*Perl_sv_free2)(pTHX_ SV*);
+# endif
 static void (*Perl_sys_init)(int* argc, char*** argv);
 static void (*Perl_sys_term)(void);
 static void (*Perl_call_list)(pTHX_ I32, AV*);
@@ -395,11 +403,9 @@
     {"perl_parse", (PERL_PROC*)&perl_parse},
     {"Perl_get_context", (PERL_PROC*)&Perl_get_context},
     {"Perl_croak", (PERL_PROC*)&Perl_croak},
-#ifndef PERL5180_OR_LATER
 #ifdef PERL5101_OR_LATER
     {"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage},
 #endif
-#endif
     {"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext},
     {"Perl_dowantarray", (PERL_PROC*)&Perl_dowantarray},
     {"Perl_free_tmps", (PERL_PROC*)&Perl_free_tmps},
@@ -503,6 +509,14 @@
     {"", NULL},
 };
 
+/* Work around for perl-5.18.
+ * The definitions of S_SvREFCNT_inc and S_SvREFCNT_dec are needed, so include
+ * "perl\lib\CORE\inline.h", after Perl_sv_free2 is defined.
+ * The linker won't complain about undefined __impl_Perl_sv_free2. */
+#if (PERL_REVISION == 5) && (PERL_VERSION >= 18)
+# include <inline.h>
+#endif
+
 /*
  * Make all runtime-links of perl.
  *

Raspunde prin e-mail lui