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