Blame SOURCES/7.4.570

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