Skip to content

Commit ef75f15

Browse files
committed
updated for version 7.3.834
Problem: Ruby 2.0 has a few API changes. Solution: Add handling of Ruby 2.0. (Yasuhiro Matsumoto)
1 parent b19bb29 commit ef75f15

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/if_ruby.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ static void ruby_vim_init(void);
189189
#ifndef RUBY19_OR_LATER
190190
#define rb_num2long dll_rb_num2long
191191
#endif
192+
#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 19
192193
#define rb_num2ulong dll_rb_num2ulong
194+
#endif
193195
#define rb_obj_alloc dll_rb_obj_alloc
194196
#define rb_obj_as_string dll_rb_obj_as_string
195197
#define rb_obj_id dll_rb_obj_id
@@ -344,6 +346,17 @@ VALUE rb_int2big_stub(SIGNED_VALUE x)
344346
{
345347
return dll_rb_int2big(x);
346348
}
349+
#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20
350+
VALUE
351+
rb_float_new_in_heap(double d)
352+
{
353+
return dll_rb_float_new(d);
354+
}
355+
unsigned long rb_num2ulong(VALUE x)
356+
{
357+
return (long)RSHIFT((SIGNED_VALUE)(x),1);
358+
}
359+
#endif
347360
#endif
348361

349362
static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */
@@ -434,7 +447,11 @@ static struct
434447
#endif
435448
#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
436449
{"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr},
450+
# if DYNAMIC_RUBY_VER <= 19
437451
{"rb_float_new", (RUBY_PROC*)&dll_rb_float_new},
452+
# else
453+
{"rb_float_new_in_heap", (RUBY_PROC*)&dll_rb_float_new},
454+
# endif
438455
{"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new},
439456
{"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push},
440457
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ static char *(features[]) =
728728

729729
static int included_patches[] =
730730
{ /* Add new patch number below this line */
731+
/**/
732+
834,
731733
/**/
732734
833,
733735
/**/

0 commit comments

Comments
 (0)