diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-02-26 13:41:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-02-26 13:41:35 +0100 |
commit | 886ed691d26dd0253608eee174fecc24130e4de7 (patch) | |
tree | 65a521a140a2e455f693912c3793225ee3c793eb | |
parent | 40cf4b44ed6c7fae7d35b0652911cf7c97d9f2a2 (diff) | |
download | vim-git-886ed691d26dd0253608eee174fecc24130e4de7.tar.gz |
updated for version 7.3.834v7.3.834
Problem: Ruby 2.0 has a few API changes.
Solution: Add handling of Ruby 2.0. (Yasuhiro Matsumoto)
-rw-r--r-- | src/if_ruby.c | 17 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c index ce40bbe8a..818aacbfc 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -189,7 +189,9 @@ static void ruby_vim_init(void); #ifndef RUBY19_OR_LATER #define rb_num2long dll_rb_num2long #endif +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 19 #define rb_num2ulong dll_rb_num2ulong +#endif #define rb_obj_alloc dll_rb_obj_alloc #define rb_obj_as_string dll_rb_obj_as_string #define rb_obj_id dll_rb_obj_id @@ -344,6 +346,17 @@ VALUE rb_int2big_stub(SIGNED_VALUE x) { return dll_rb_int2big(x); } +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 +VALUE +rb_float_new_in_heap(double d) +{ + return dll_rb_float_new(d); +} +unsigned long rb_num2ulong(VALUE x) +{ + return (long)RSHIFT((SIGNED_VALUE)(x),1); +} +#endif #endif static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */ @@ -434,7 +447,11 @@ static struct #endif #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, +# if DYNAMIC_RUBY_VER <= 19 {"rb_float_new", (RUBY_PROC*)&dll_rb_float_new}, +# else + {"rb_float_new_in_heap", (RUBY_PROC*)&dll_rb_float_new}, +# endif {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, #endif diff --git a/src/version.c b/src/version.c index 3ab854834..309732afb 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 834, +/**/ 833, /**/ 832, |