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