home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.066 < prev    next >
Encoding:
Internet Message Format  |  2003-10-13  |  7.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.066 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.066 (extra)
  11. Problem:    Ruby interface doesn't work with Ruby 1.8.0.
  12. Solution:   Change "defout" to "stdout". (Aron Grifis)
  13.         Change dynamic loading. (Taro Muraoka)
  14. Files:        src/if_ruby.c, src/Make_mvc.mak
  15.  
  16.  
  17. *** ../vim-6.2.065/src/if_ruby.c    Sat Apr 19 15:21:16 2003
  18. --- src/if_ruby.c    Fri Aug  8 20:43:45 2003
  19. ***************
  20. *** 12,18 ****
  21.   #include <string.h>
  22.   
  23.   #ifdef _WIN32
  24. ! # define NT
  25.   # ifndef DYNAMIC_RUBY
  26.   #  define IMPORT /* For static dll usage __declspec(dllimport) */
  27.   #  define RUBYEXTERN __declspec(dllimport)
  28. --- 12,20 ----
  29.   #include <string.h>
  30.   
  31.   #ifdef _WIN32
  32. ! # if !defined(DYNAMIC_RUBY_VER) || (DYNAMIC_RUBY_VER < 18)
  33. ! #   define NT
  34. ! # endif
  35.   # ifndef DYNAMIC_RUBY
  36.   #  define IMPORT /* For static dll usage __declspec(dllimport) */
  37.   #  define RUBYEXTERN __declspec(dllimport)
  38. ***************
  39. *** 33,38 ****
  40. --- 35,49 ----
  41.   # define rb_cNilClass        (*dll_rb_cNilClass)
  42.   # define rb_cSymbol        (*dll_rb_cSymbol)
  43.   # define rb_cTrueClass        (*dll_rb_cTrueClass)
  44. + # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
  45. + /*
  46. +  * On ver 1.8, all Ruby functions are exported with "__declspce(dllimport)"
  47. +  * in ruby.h.  But it cause trouble for these variables, because it is
  48. +  * defined in this file.  When defined this RUBY_EXPORT it modified to
  49. +  * "extern" and be able to avoid this problem.
  50. +  */
  51. + #  define RUBY_EXPORT
  52. + # endif
  53.   #endif
  54.   
  55.   #include <ruby.h>
  56. ***************
  57. *** 83,89 ****
  58.   #define rb_define_module_function    dll_rb_define_module_function
  59.   #define rb_define_singleton_method    dll_rb_define_singleton_method
  60.   #define rb_define_virtual_variable    dll_rb_define_virtual_variable
  61. ! #define rb_defout            (*dll_rb_defout)
  62.   #define rb_eArgError            (*dll_rb_eArgError)
  63.   #define rb_eIndexError            (*dll_rb_eIndexError)
  64.   #define rb_eRuntimeError        (*dll_rb_eRuntimeError)
  65. --- 94,100 ----
  66.   #define rb_define_module_function    dll_rb_define_module_function
  67.   #define rb_define_singleton_method    dll_rb_define_singleton_method
  68.   #define rb_define_virtual_variable    dll_rb_define_virtual_variable
  69. ! #define rb_stdout            (*dll_rb_stdout)
  70.   #define rb_eArgError            (*dll_rb_eArgError)
  71.   #define rb_eIndexError            (*dll_rb_eIndexError)
  72.   #define rb_eRuntimeError        (*dll_rb_eRuntimeError)
  73. ***************
  74. *** 111,116 ****
  75. --- 122,130 ----
  76.   #define ruby_errinfo            (*dll_ruby_errinfo)
  77.   #define ruby_init            dll_ruby_init
  78.   #define ruby_init_loadpath        dll_ruby_init_loadpath
  79. + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
  80. + # define rb_w32_snprintf        dll_rb_w32_snprintf
  81. + #endif
  82.   
  83.   /*
  84.    * Pointers for dynamic link
  85. ***************
  86. *** 133,139 ****
  87.   static void (*dll_rb_define_module_function) (VALUE,const char*,VALUE(*)(),int);
  88.   static void (*dll_rb_define_singleton_method) (VALUE,const char*,VALUE(*)(),int);
  89.   static void (*dll_rb_define_virtual_variable) (const char*,VALUE(*)(),void(*)());
  90. ! static VALUE *dll_rb_defout;
  91.   static VALUE *dll_rb_eArgError;
  92.   static VALUE *dll_rb_eIndexError;
  93.   static VALUE *dll_rb_eRuntimeError;
  94. --- 147,153 ----
  95.   static void (*dll_rb_define_module_function) (VALUE,const char*,VALUE(*)(),int);
  96.   static void (*dll_rb_define_singleton_method) (VALUE,const char*,VALUE(*)(),int);
  97.   static void (*dll_rb_define_virtual_variable) (const char*,VALUE(*)(),void(*)());
  98. ! static VALUE *dll_rb_stdout;
  99.   static VALUE *dll_rb_eArgError;
  100.   static VALUE *dll_rb_eIndexError;
  101.   static VALUE *dll_rb_eRuntimeError;
  102. ***************
  103. *** 162,167 ****
  104. --- 176,182 ----
  105.   static VALUE *dll_ruby_errinfo;
  106.   static void (*dll_ruby_init) (void);
  107.   static void (*dll_ruby_init_loadpath) (void);
  108. + static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
  109.   
  110.   static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */
  111.   
  112. ***************
  113. *** 193,199 ****
  114.       {"rb_define_module_function", (RUBY_PROC*)&dll_rb_define_module_function},
  115.       {"rb_define_singleton_method", (RUBY_PROC*)&dll_rb_define_singleton_method},
  116.       {"rb_define_virtual_variable", (RUBY_PROC*)&dll_rb_define_virtual_variable},
  117. !     {"rb_defout", (RUBY_PROC*)&dll_rb_defout},
  118.       {"rb_eArgError", (RUBY_PROC*)&dll_rb_eArgError},
  119.       {"rb_eIndexError", (RUBY_PROC*)&dll_rb_eIndexError},
  120.       {"rb_eRuntimeError", (RUBY_PROC*)&dll_rb_eRuntimeError},
  121. --- 208,214 ----
  122.       {"rb_define_module_function", (RUBY_PROC*)&dll_rb_define_module_function},
  123.       {"rb_define_singleton_method", (RUBY_PROC*)&dll_rb_define_singleton_method},
  124.       {"rb_define_virtual_variable", (RUBY_PROC*)&dll_rb_define_virtual_variable},
  125. !     {"rb_stdout", (RUBY_PROC*)&dll_rb_stdout},
  126.       {"rb_eArgError", (RUBY_PROC*)&dll_rb_eArgError},
  127.       {"rb_eIndexError", (RUBY_PROC*)&dll_rb_eIndexError},
  128.       {"rb_eRuntimeError", (RUBY_PROC*)&dll_rb_eRuntimeError},
  129. ***************
  130. *** 221,226 ****
  131. --- 236,242 ----
  132.       {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo},
  133.       {"ruby_init", (RUBY_PROC*)&dll_ruby_init},
  134.       {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
  135. +     {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
  136.       {"", NULL},
  137.   };
  138.   
  139. ***************
  140. *** 782,792 ****
  141.   static void ruby_io_init(void)
  142.   {
  143.   #ifndef DYNAMIC_RUBY
  144. !     RUBYEXTERN VALUE rb_defout;
  145.   #endif
  146.   
  147. !     rb_defout = rb_obj_alloc(rb_cObject);
  148. !     rb_define_singleton_method(rb_defout, "write", vim_message, 1);
  149.       rb_define_global_function("p", f_p, -1);
  150.   }
  151.   
  152. --- 798,808 ----
  153.   static void ruby_io_init(void)
  154.   {
  155.   #ifndef DYNAMIC_RUBY
  156. !     RUBYEXTERN VALUE rb_stdout;
  157.   #endif
  158.   
  159. !     rb_stdout = rb_obj_alloc(rb_cObject);
  160. !     rb_define_singleton_method(rb_stdout, "write", vim_message, 1);
  161.       rb_define_global_function("p", f_p, -1);
  162.   }
  163.   
  164. *** ../vim-6.2.065/src/Make_mvc.mak    Sun Jul 27 15:09:30 2003
  165. --- src/Make_mvc.mak    Fri Aug  8 20:43:46 2003
  166. ***************
  167. *** 506,515 ****
  168. --- 506,527 ----
  169.   !ifndef RUBY_VER_LONG
  170.   RUBY_VER_LONG = 1.6
  171.   !endif
  172. + !if $(RUBY_VER) >= 18
  173. + !ifndef RUBY_PLATFORM
  174. + RUBY_PLATFORM = i386-mswin32
  175. + !endif
  176. + !ifndef RUBY_INSTALL_NAME
  177. + RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
  178. + !endif
  179. + !else
  180.   !ifndef RUBY_PLATFORM
  181.   RUBY_PLATFORM = i586-mswin32
  182.   !endif
  183. + !ifndef RUBY_INSTALL_NAME
  184.   RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
  185. + !endif
  186. + !endif # $(RUBY_VER) >= 18
  187.   
  188.   !message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
  189.   CFLAGS = $(CFLAGS) -DFEAT_RUBY
  190. ***************
  191. *** 519,525 ****
  192.   # Do we want to load Ruby dynamically?
  193.   !if "$(DYNAMIC_RUBY)" == "yes"
  194.   !message Ruby DLL will be loaded dynamically
  195. ! CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
  196.   !undef RUBY_LIB
  197.   !endif
  198.   !endif # RUBY
  199. --- 531,537 ----
  200.   # Do we want to load Ruby dynamically?
  201.   !if "$(DYNAMIC_RUBY)" == "yes"
  202.   !message Ruby DLL will be loaded dynamically
  203. ! CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" -DDYNAMIC_RUBY_VER=$(RUBY_VER)
  204.   !undef RUBY_LIB
  205.   !endif
  206.   !endif # RUBY
  207. *** ../vim-6.2.065/src/version.c    Sun Aug 10 22:34:58 2003
  208. --- src/version.c    Sun Aug 10 22:36:36 2003
  209. ***************
  210. *** 632,633 ****
  211. --- 632,635 ----
  212.   {   /* Add new patch number below this line */
  213. + /**/
  214. +     66,
  215.   /**/
  216.  
  217. -- 
  218. From "know your smileys":
  219.  <<<:-{    Worf (Never smiles anyways, so he's a bad smiley)
  220.  
  221.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  222. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  223. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  224.  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
  225.