Hi,

2017/1/15 Sun 9:52:05 UTC+9 Cesar wrote:
> On 14/01/2017 02:12 p.m., Bram Moolenaar wrote:
>  >
>  > Patch 8.0.0187
>  > Problem:    Building with a new Ruby version fails.
>  > Solution:   Use ruby_sysinit() instead of NtInitialize(). (Tomas Volf,
>  >              closes #1382)
>  > Files:      src/if_ruby.c
>  >
>  >
>  > *** ../vim-8.0.0186/src/if_ruby.c  2017-01-09 21:10:29.300184895 +0100
>  > --- src/if_ruby.c  2017-01-14 20:09:54.001642368 +0100
>  > ***************
>  > *** 862,868 ****
>  > --- 862,872 ----
>  >                int argc = 1;
>  >                char *argv[] = {"gvim.exe"};
>  >                char **argvp = argv;
>  > + # ifdef RUBY19_OR_LATER
>  > +      ruby_sysinit(&argc,&argvp);
>  > + # else
>  >                NtInitialize(&argc,&argvp);
>  > + # endif
>  >    #endif
>  >                {
>  >    #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
>  > *** ../vim-8.0.0186/src/version.c  2017-01-14 20:06:11.127087707 +0100
>  > --- src/version.c  2017-01-14 20:11:17.953098490 +0100
>  > ***************
>  > *** 766,767 ****
>  > --- 766,769 ----
>  >    {   /* Add new patch number below this line */
>  > + /**/
>  > +     187,
>  >    /**/
>  >
> 
> I'm building vim on Windows 7 with MinGW. After compiling the latest
> pull I get:
> 
> --------------------
> [...]
> gobjZi686/if_ruby.o:if_ruby.c:(.text+0x862): undefined reference to 
> `ruby_sysinit'
> gobjZi686/if_ruby.o:if_ruby.c:(.text+0x23fa): undefined reference to 
> `ruby_sysinit'
> collect2.exe: error: ld returned 1 exit status
> make: *** [gvim.exe] Error 1
> Error by compiling gvim.exe
> --------------------
> 
> Many thanks in advance,

I think this patch should be reverted. As I wrote in the issue #1381, currently
no one maintains static linking to Ruby on Windows. The +ruby/dyn version on
Windows already uses ruby_sysinit() instead of NtInitialize(). See:
https://github.com/vim/vim/blob/fe6ce331d94c24ad745d0bf329ec0a65a5c07cc9/src/if_ruby.c#L598-L603

How about attached patch?

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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent  ed9d2f4103ec083d72c42773f1589a6a964914e5

diff --git a/src/if_ruby.c b/src/if_ruby.c
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -199,6 +199,12 @@ static void ruby_vim_init(void);
 # endif
 #endif
 
+#if defined(RUBY19_OR_LATER) && !defined(DYNAMIC_RUBY)
+# ifdef WIN3264
+#  define NtInitialize			ruby_sysinit
+# endif
+#endif
+
 #if defined(DYNAMIC_RUBY) || defined(PROTO)
 # if defined(PROTO) && !defined(HINSTANCE)
 #  define HINSTANCE int		/* for generating prototypes */
@@ -865,11 +871,7 @@ static int ensure_ruby_initialized(void)
 	    int argc = 1;
 	    char *argv[] = {"gvim.exe"};
 	    char **argvp = argv;
-# ifdef RUBY19_OR_LATER
-	    ruby_sysinit(&argc, &argvp);
-# else
 	    NtInitialize(&argc, &argvp);
-# endif
 #endif
 	    {
 #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)

Raspunde prin e-mail lui