|
73 | 73 | # define rb_num2int rb_num2int_stub |
74 | 74 | # endif |
75 | 75 |
|
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 | | - |
81 | 76 | # if RUBY_VERSION == 21 |
82 | 77 | // Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses |
83 | 78 | // rb_gc_writebarrier_unprotect_promoted if USE_RGENGC |
@@ -248,6 +243,12 @@ static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv); |
248 | 243 | # if RUBY_VERSION < 30 |
249 | 244 | # define rb_check_type dll_rb_check_type |
250 | 245 | # endif |
| 246 | +# ifdef USE_TYPEDDATA |
| 247 | +# if RUBY_VERSION >= 40 |
| 248 | +# define rbimpl_check_typeddata dll_rbimpl_check_typeddata |
| 249 | +# endif |
| 250 | +# define rb_check_typeddata dll_rb_check_typeddata |
| 251 | +# endif |
251 | 252 | # define rb_class_path dll_rb_class_path |
252 | 253 | # ifdef USE_TYPEDDATA |
253 | 254 | # if RUBY_VERSION >= 23 |
@@ -375,6 +376,9 @@ VALUE *dll_rb_cTrueClass; |
375 | 376 | static VALUE (*dll_rb_class_new_instance) (int,VALUE*,VALUE); |
376 | 377 | static void (*dll_rb_check_type) (VALUE,int); |
377 | 378 | # ifdef USE_TYPEDDATA |
| 379 | +# if RUBY_VERSION >= 40 |
| 380 | +static void *(*dll_rbimpl_check_typeddata) (VALUE,const rb_data_type_t *); |
| 381 | +# endif |
378 | 382 | static void *(*dll_rb_check_typeddata) (VALUE,const rb_data_type_t *); |
379 | 383 | # endif |
380 | 384 | static VALUE (*dll_rb_class_path) (VALUE); |
@@ -603,12 +607,6 @@ rb_unexpected_type_stub(VALUE self, int t) |
603 | 607 | dll_rb_unexpected_type(self, t); |
604 | 608 | } |
605 | 609 | # 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 |
612 | 610 | # endif // ifndef PROTO |
613 | 611 |
|
614 | 612 | static HINSTANCE hinstRuby = NULL; // Instance of ruby.dll |
|
0 commit comments