Karsten Hopp fa32f5
To: vim_dev@googlegroups.com
Karsten Hopp fa32f5
Subject: Patch 7.4.168
Karsten Hopp fa32f5
Fcc: outbox
Karsten Hopp fa32f5
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp fa32f5
Mime-Version: 1.0
Karsten Hopp fa32f5
Content-Type: text/plain; charset=UTF-8
Karsten Hopp fa32f5
Content-Transfer-Encoding: 8bit
Karsten Hopp fa32f5
------------
Karsten Hopp fa32f5
Karsten Hopp fa32f5
Patch 7.4.168
Karsten Hopp fa32f5
Problem:    Can't compile with Ruby 2.1.0.
Karsten Hopp fa32f5
Solution:   Add support for new GC. (Kohei Suzuki)
Karsten Hopp fa32f5
Files:	    src/if_ruby.c
Karsten Hopp fa32f5
Karsten Hopp fa32f5
Karsten Hopp fa32f5
*** ../vim-7.4.167/src/if_ruby.c	2013-05-20 12:47:48.000000000 +0200
Karsten Hopp fa32f5
--- src/if_ruby.c	2014-02-05 22:35:17.378577243 +0100
Karsten Hopp fa32f5
***************
Karsten Hopp fa32f5
*** 96,101 ****
Karsten Hopp fa32f5
--- 96,107 ----
Karsten Hopp fa32f5
  # define rb_num2int rb_num2int_stub
Karsten Hopp fa32f5
  #endif
Karsten Hopp fa32f5
  
Karsten Hopp fa32f5
+ # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
Karsten Hopp fa32f5
+ /* Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses
Karsten Hopp fa32f5
+  * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC  */
Karsten Hopp fa32f5
+ #  define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
Karsten Hopp fa32f5
+ # endif
Karsten Hopp fa32f5
+ 
Karsten Hopp fa32f5
  #include <ruby.h>
Karsten Hopp fa32f5
  #ifdef RUBY19_OR_LATER
Karsten Hopp fa32f5
  # include <ruby/encoding.h>
Karsten Hopp fa32f5
***************
Karsten Hopp fa32f5
*** 373,378 ****
Karsten Hopp fa32f5
--- 379,388 ----
Karsten Hopp fa32f5
  static void* (*ruby_process_options)(int, char**);
Karsten Hopp fa32f5
  # endif
Karsten Hopp fa32f5
  
Karsten Hopp fa32f5
+ # if defined(USE_RGENGC) && USE_RGENGC
Karsten Hopp fa32f5
+ static void (*dll_rb_gc_writebarrier_unprotect_promoted)(VALUE);
Karsten Hopp fa32f5
+ # endif
Karsten Hopp fa32f5
+ 
Karsten Hopp fa32f5
  # if defined(RUBY19_OR_LATER) && !defined(PROTO)
Karsten Hopp fa32f5
  SIGNED_VALUE rb_num2long_stub(VALUE x)
Karsten Hopp fa32f5
  {
Karsten Hopp fa32f5
***************
Karsten Hopp fa32f5
*** 406,411 ****
Karsten Hopp fa32f5
--- 416,428 ----
Karsten Hopp fa32f5
  #  endif
Karsten Hopp fa32f5
  # endif
Karsten Hopp fa32f5
  
Karsten Hopp fa32f5
+ # if defined(USE_RGENGC) && USE_RGENGC
Karsten Hopp fa32f5
+ void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj)
Karsten Hopp fa32f5
+ {
Karsten Hopp fa32f5
+     return dll_rb_gc_writebarrier_unprotect_promoted(obj);
Karsten Hopp fa32f5
+ }
Karsten Hopp fa32f5
+ # endif
Karsten Hopp fa32f5
+ 
Karsten Hopp fa32f5
  static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */
Karsten Hopp fa32f5
  
Karsten Hopp fa32f5
  /*
Karsten Hopp fa32f5
***************
Karsten Hopp fa32f5
*** 521,526 ****
Karsten Hopp fa32f5
--- 538,546 ----
Karsten Hopp fa32f5
  #  endif
Karsten Hopp fa32f5
      {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
Karsten Hopp fa32f5
  # endif
Karsten Hopp fa32f5
+ # if defined(USE_RGENGC) && USE_RGENGC
Karsten Hopp fa32f5
+     {"rb_gc_writebarrier_unprotect_promoted", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect_promoted},
Karsten Hopp fa32f5
+ # endif
Karsten Hopp fa32f5
      {"", NULL},
Karsten Hopp fa32f5
  };
Karsten Hopp fa32f5
  
Karsten Hopp fa32f5
*** ../vim-7.4.167/src/version.c	2014-02-05 22:25:29.982568243 +0100
Karsten Hopp fa32f5
--- src/version.c	2014-02-05 22:36:14.010578111 +0100
Karsten Hopp fa32f5
***************
Karsten Hopp fa32f5
*** 740,741 ****
Karsten Hopp fa32f5
--- 740,743 ----
Karsten Hopp fa32f5
  {   /* Add new patch number below this line */
Karsten Hopp fa32f5
+ /**/
Karsten Hopp fa32f5
+     168,
Karsten Hopp fa32f5
  /**/
Karsten Hopp fa32f5
Karsten Hopp fa32f5
-- 
Karsten Hopp fa32f5
hundred-and-one symptoms of being an internet addict:
Karsten Hopp fa32f5
10E. You start counting in hex.
Karsten Hopp fa32f5
Karsten Hopp fa32f5
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp fa32f5
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp fa32f5
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp fa32f5
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///