3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.570
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.570
3ef2ca
Problem:    Building with dynamic library does not work for Ruby 2.2.0
3ef2ca
Solution:   Change #ifdefs and #defines. (Ken Takata)
3ef2ca
Files:	    src/if_ruby.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.569/src/if_ruby.c	2014-11-27 17:44:05.376820913 +0100
3ef2ca
--- src/if_ruby.c	2015-01-14 14:02:59.680115042 +0100
3ef2ca
***************
3ef2ca
*** 96,106 ****
3ef2ca
  # define rb_num2int rb_num2int_stub
3ef2ca
  #endif
3ef2ca
  
3ef2ca
! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
3ef2ca
  /* Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses
3ef2ca
   * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC  */
3ef2ca
  # define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
3ef2ca
  #endif
3ef2ca
  
3ef2ca
  #include <ruby.h>
3ef2ca
  #ifdef RUBY19_OR_LATER
3ef2ca
--- 96,110 ----
3ef2ca
  # define rb_num2int rb_num2int_stub
3ef2ca
  #endif
3ef2ca
  
3ef2ca
! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
3ef2ca
  /* Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses
3ef2ca
   * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC  */
3ef2ca
  # define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
3ef2ca
  #endif
3ef2ca
+ #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22
3ef2ca
+ # define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub
3ef2ca
+ # define rb_check_type rb_check_type_stub
3ef2ca
+ #endif
3ef2ca
  
3ef2ca
  #include <ruby.h>
3ef2ca
  #ifdef RUBY19_OR_LATER
3ef2ca
***************
3ef2ca
*** 180,186 ****
3ef2ca
   */
3ef2ca
  # define rb_assoc_new			dll_rb_assoc_new
3ef2ca
  # define rb_cObject			(*dll_rb_cObject)
3ef2ca
! # define rb_check_type			dll_rb_check_type
3ef2ca
  # define rb_class_path			dll_rb_class_path
3ef2ca
  # define rb_data_object_alloc		dll_rb_data_object_alloc
3ef2ca
  # define rb_define_class_under		dll_rb_define_class_under
3ef2ca
--- 184,192 ----
3ef2ca
   */
3ef2ca
  # define rb_assoc_new			dll_rb_assoc_new
3ef2ca
  # define rb_cObject			(*dll_rb_cObject)
3ef2ca
! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 22
3ef2ca
! #  define rb_check_type			dll_rb_check_type
3ef2ca
! # endif
3ef2ca
  # define rb_class_path			dll_rb_class_path
3ef2ca
  # define rb_data_object_alloc		dll_rb_data_object_alloc
3ef2ca
  # define rb_define_class_under		dll_rb_define_class_under
3ef2ca
***************
3ef2ca
*** 382,388 ****
3ef2ca
--- 388,398 ----
3ef2ca
  # endif
3ef2ca
  
3ef2ca
  # if defined(USE_RGENGC) && USE_RGENGC
3ef2ca
+ #  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
3ef2ca
  static void (*dll_rb_gc_writebarrier_unprotect_promoted)(VALUE);
3ef2ca
+ #  else
3ef2ca
+ static void (*dll_rb_gc_writebarrier_unprotect)(VALUE obj);
3ef2ca
+ #  endif
3ef2ca
  # endif
3ef2ca
  
3ef2ca
  # if defined(RUBY19_OR_LATER) && !defined(PROTO)
3ef2ca
***************
3ef2ca
*** 420,429 ****
3ef2ca
--- 430,453 ----
3ef2ca
  
3ef2ca
     /* Do not generate a prototype here, VALUE isn't always defined. */
3ef2ca
  # if defined(USE_RGENGC) && USE_RGENGC && !defined(PROTO)
3ef2ca
+ #  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
3ef2ca
  void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj)
3ef2ca
  {
3ef2ca
      dll_rb_gc_writebarrier_unprotect_promoted(obj);
3ef2ca
  }
3ef2ca
+ #  else
3ef2ca
+ void rb_gc_writebarrier_unprotect_stub(VALUE obj)
3ef2ca
+ {
3ef2ca
+     dll_rb_gc_writebarrier_unprotect(obj);
3ef2ca
+ }
3ef2ca
+ #  endif
3ef2ca
+ # endif
3ef2ca
+ 
3ef2ca
+ # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22
3ef2ca
+ void rb_check_type_stub(VALUE v, int i)
3ef2ca
+ {
3ef2ca
+     dll_rb_check_type(v, i);
3ef2ca
+ }
3ef2ca
  # endif
3ef2ca
  
3ef2ca
  static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */
3ef2ca
***************
3ef2ca
*** 542,548 ****
3ef2ca
--- 566,576 ----
3ef2ca
      {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
3ef2ca
  # endif
3ef2ca
  # if defined(USE_RGENGC) && USE_RGENGC
3ef2ca
+ #  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
3ef2ca
      {"rb_gc_writebarrier_unprotect_promoted", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect_promoted},
3ef2ca
+ #  else
3ef2ca
+     {"rb_gc_writebarrier_unprotect", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect},
3ef2ca
+ #  endif
3ef2ca
  # endif
3ef2ca
      {"", NULL},
3ef2ca
  };
3ef2ca
*** ../vim-7.4.569/src/version.c	2015-01-14 12:44:38.407422077 +0100
3ef2ca
--- src/version.c	2015-01-14 14:02:53.868178396 +0100
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     570,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
89. In addition to your e-mail address being on your business
3ef2ca
    cards you even have your own domain.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///