Skip to content

Commit 7b8e921

Browse files
committed
test Ruby fix
1 parent 644db08 commit 7b8e921

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/if_ruby.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@
7373
# define rb_num2int rb_num2int_stub
7474
# endif
7575

76+
# if RUBY_VERSION >= 20
77+
// USE_TYPEDDATA is not defined yet. We just check for 2.0.
78+
# define rb_check_typeddata rb_check_typeddata_stub
79+
#endif
80+
7681
# if RUBY_VERSION == 21
7782
// Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses
7883
// rb_gc_writebarrier_unprotect_promoted if USE_RGENGC
@@ -243,9 +248,6 @@ static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv);
243248
# if RUBY_VERSION < 30
244249
# define rb_check_type dll_rb_check_type
245250
# endif
246-
# ifdef USE_TYPEDDATA
247-
# define rb_check_typeddata dll_rb_check_typeddata
248-
# endif
249251
# define rb_class_path dll_rb_class_path
250252
# ifdef USE_TYPEDDATA
251253
# if RUBY_VERSION >= 23
@@ -601,6 +603,12 @@ rb_unexpected_type_stub(VALUE self, int t)
601603
dll_rb_unexpected_type(self, t);
602604
}
603605
# endif
606+
# ifdef USE_TYPEDDATA
607+
void *rb_check_typeddata_stub(VALUE obj, const rb_data_type_t *data_type)
608+
{
609+
return dll_rb_check_typeddata(obj, data_type);
610+
}
611+
# endif
604612
# endif // ifndef PROTO
605613

606614
static HINSTANCE hinstRuby = NULL; // Instance of ruby.dll

0 commit comments

Comments
 (0)