Karsten Hopp f93f47
To: vim-dev@vim.org
Karsten Hopp f93f47
Subject: Patch 7.2.360
Karsten Hopp f93f47
Fcc: outbox
Karsten Hopp f93f47
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f93f47
Mime-Version: 1.0
Karsten Hopp f93f47
Content-Type: text/plain; charset=UTF-8
Karsten Hopp f93f47
Content-Transfer-Encoding: 8bit
Karsten Hopp f93f47
------------
Karsten Hopp f93f47
Karsten Hopp f93f47
Patch 7.2.360
Karsten Hopp f93f47
Problem:    Ruby on MS-Windows: can't use sockets.
Karsten Hopp f93f47
Solution:   Call NtInitialize() during initialization. (Ariya Mizutani)
Karsten Hopp f93f47
Files:	    src/if_ruby.c
Karsten Hopp f93f47
Karsten Hopp f93f47
Karsten Hopp f93f47
*** ../vim-7.2.359/src/if_ruby.c	2009-05-22 18:20:23.000000000 +0200
Karsten Hopp f93f47
--- src/if_ruby.c	2010-02-17 15:04:00.000000000 +0100
Karsten Hopp f93f47
***************
Karsten Hopp f93f47
*** 48,53 ****
Karsten Hopp f93f47
--- 48,58 ----
Karsten Hopp f93f47
  # endif
Karsten Hopp f93f47
  #endif
Karsten Hopp f93f47
  
Karsten Hopp f93f47
+ /* suggested by Ariya Mizutani */
Karsten Hopp f93f47
+ #if (_MSC_VER == 1200)
Karsten Hopp f93f47
+ # undef _WIN32_WINNT
Karsten Hopp f93f47
+ #endif
Karsten Hopp f93f47
+ 
Karsten Hopp f93f47
  #include <ruby.h>
Karsten Hopp f93f47
  
Karsten Hopp f93f47
  #undef EXTERN
Karsten Hopp f93f47
***************
Karsten Hopp f93f47
*** 132,137 ****
Karsten Hopp f93f47
--- 137,143 ----
Karsten Hopp f93f47
  #define ruby_errinfo			(*dll_ruby_errinfo)
Karsten Hopp f93f47
  #define ruby_init			dll_ruby_init
Karsten Hopp f93f47
  #define ruby_init_loadpath		dll_ruby_init_loadpath
Karsten Hopp f93f47
+ #define NtInitialize			dll_NtInitialize
Karsten Hopp f93f47
  #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp f93f47
  # define rb_w32_snprintf		dll_rb_w32_snprintf
Karsten Hopp f93f47
  #endif
Karsten Hopp f93f47
***************
Karsten Hopp f93f47
*** 186,191 ****
Karsten Hopp f93f47
--- 192,198 ----
Karsten Hopp f93f47
  static VALUE *dll_ruby_errinfo;
Karsten Hopp f93f47
  static void (*dll_ruby_init) (void);
Karsten Hopp f93f47
  static void (*dll_ruby_init_loadpath) (void);
Karsten Hopp f93f47
+ static void (*dll_NtInitialize) (int*, char***);
Karsten Hopp f93f47
  #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp f93f47
  static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
Karsten Hopp f93f47
  #endif
Karsten Hopp f93f47
***************
Karsten Hopp f93f47
*** 248,253 ****
Karsten Hopp f93f47
--- 255,261 ----
Karsten Hopp f93f47
      {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo},
Karsten Hopp f93f47
      {"ruby_init", (RUBY_PROC*)&dll_ruby_init},
Karsten Hopp f93f47
      {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
Karsten Hopp f93f47
+     {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize},
Karsten Hopp f93f47
  #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp f93f47
      {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
Karsten Hopp f93f47
  #endif
Karsten Hopp f93f47
***************
Karsten Hopp f93f47
*** 414,419 ****
Karsten Hopp f93f47
--- 422,433 ----
Karsten Hopp f93f47
  	if (ruby_enabled(TRUE))
Karsten Hopp f93f47
  	{
Karsten Hopp f93f47
  #endif
Karsten Hopp f93f47
+ #ifdef _WIN32
Karsten Hopp f93f47
+ 	    /* suggested by Ariya Mizutani */
Karsten Hopp f93f47
+ 	    int argc = 1;
Karsten Hopp f93f47
+ 	    char *argv[] = {"gvim.exe"};
Karsten Hopp f93f47
+ 	    NtInitialize(&argc, &argv);
Karsten Hopp f93f47
+ #endif
Karsten Hopp f93f47
  	    ruby_init();
Karsten Hopp f93f47
  	    ruby_init_loadpath();
Karsten Hopp f93f47
  	    ruby_io_init();
Karsten Hopp f93f47
*** ../vim-7.2.359/src/version.c	2010-02-11 18:54:38.000000000 +0100
Karsten Hopp f93f47
--- src/version.c	2010-02-17 15:10:22.000000000 +0100
Karsten Hopp f93f47
***************
Karsten Hopp f93f47
*** 683,684 ****
Karsten Hopp f93f47
--- 683,686 ----
Karsten Hopp f93f47
  {   /* Add new patch number below this line */
Karsten Hopp f93f47
+ /**/
Karsten Hopp f93f47
+     360,
Karsten Hopp f93f47
  /**/
Karsten Hopp f93f47
Karsten Hopp f93f47
-- 
Karsten Hopp f93f47
"After a few years of marriage a man can look right at a woman
Karsten Hopp f93f47
without seeing her and a woman can see right through a man
Karsten Hopp f93f47
without looking at him."
Karsten Hopp f93f47
 - Helen Rowland
Karsten Hopp f93f47
Karsten Hopp f93f47
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f93f47
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f93f47
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp f93f47
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///