]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.570 v7.4.570
authorBram Moolenaar <Bram@vim.org>
Wed, 14 Jan 2015 13:04:10 +0000 (14:04 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 14 Jan 2015 13:04:10 +0000 (14:04 +0100)
Problem:    Building with dynamic library does not work for Ruby 2.2.0
Solution:   Change #ifdefs and #defines. (Ken Takata)

src/if_ruby.c
src/version.c

index eb6141fbc323bde1e2772025ac128c7930beed65..3b9f476619ef0229f879bdc24a27df82ee26e5cf 100644 (file)
 # define rb_num2int rb_num2int_stub
 #endif
 
-#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
 /* Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses
  * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC  */
 # define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
 #endif
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22
+# define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub
+# define rb_check_type rb_check_type_stub
+#endif
 
 #include <ruby.h>
 #ifdef RUBY19_OR_LATER
@@ -180,7 +184,9 @@ static void ruby_vim_init(void);
  */
 # define rb_assoc_new                  dll_rb_assoc_new
 # define rb_cObject                    (*dll_rb_cObject)
-# define rb_check_type                 dll_rb_check_type
+# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 22
+#  define rb_check_type                        dll_rb_check_type
+# endif
 # define rb_class_path                 dll_rb_class_path
 # define rb_data_object_alloc          dll_rb_data_object_alloc
 # define rb_define_class_under         dll_rb_define_class_under
@@ -382,7 +388,11 @@ static void* (*ruby_process_options)(int, char**);
 # endif
 
 # if defined(USE_RGENGC) && USE_RGENGC
+#  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
 static void (*dll_rb_gc_writebarrier_unprotect_promoted)(VALUE);
+#  else
+static void (*dll_rb_gc_writebarrier_unprotect)(VALUE obj);
+#  endif
 # endif
 
 # if defined(RUBY19_OR_LATER) && !defined(PROTO)
@@ -420,10 +430,24 @@ VALUE rb_num2ulong(VALUE x)
 
    /* Do not generate a prototype here, VALUE isn't always defined. */
 # if defined(USE_RGENGC) && USE_RGENGC && !defined(PROTO)
+#  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
 void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj)
 {
     dll_rb_gc_writebarrier_unprotect_promoted(obj);
 }
+#  else
+void rb_gc_writebarrier_unprotect_stub(VALUE obj)
+{
+    dll_rb_gc_writebarrier_unprotect(obj);
+}
+#  endif
+# endif
+
+# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22
+void rb_check_type_stub(VALUE v, int i)
+{
+    dll_rb_check_type(v, i);
+}
 # endif
 
 static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */
@@ -542,7 +566,11 @@ static struct
     {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
 # endif
 # if defined(USE_RGENGC) && USE_RGENGC
+#  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
     {"rb_gc_writebarrier_unprotect_promoted", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect_promoted},
+#  else
+    {"rb_gc_writebarrier_unprotect", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect},
+#  endif
 # endif
     {"", NULL},
 };
index a1b14941fd22fc4bca3e27e8ba4aed21eb334f63..b6e75563a05b3f770e6da05deb91f89f08ced994 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    570,
 /**/
     569,
 /**/