comparison src/if_ruby.c @ 23814:51a5c5f08bdd v8.2.2448

patch 8.2.2448: compilation error with Ruby 3.0 Commit: https://github.com/vim/vim/commit/9d20daffc296b9eb901fb14bdd83620ea55d440a Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 1 19:31:47 2021 +0100 patch 8.2.2448: compilation error with Ruby 3.0 Problem: Compilation error with Ruby 3.0. Solution: Adjust #ifdefs and declaration. (Ken Takata, closes https://github.com/vim/vim/issues/7761)
author Bram Moolenaar <Bram@vim.org>
date Mon, 01 Feb 2021 19:45:03 +0100
parents 19d54961af72
children c4298ed56ffa
comparison
equal deleted inserted replaced
23813:0f8c09579a9a 23814:51a5c5f08bdd
434 static VALUE (*dll_rb_hash_foreach) (VALUE, int (*)(VALUE, VALUE, VALUE), VALUE); 434 static VALUE (*dll_rb_hash_foreach) (VALUE, int (*)(VALUE, VALUE, VALUE), VALUE);
435 static VALUE (*dll_rb_hash_new) (void); 435 static VALUE (*dll_rb_hash_new) (void);
436 static VALUE (*dll_rb_inspect) (VALUE); 436 static VALUE (*dll_rb_inspect) (VALUE);
437 static VALUE (*dll_rb_int2inum) (long); 437 static VALUE (*dll_rb_int2inum) (long);
438 static ID (*dll_rb_intern) (const char*); 438 static ID (*dll_rb_intern) (const char*);
439 # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG // 64 bits only 439 # if RUBY_VERSION >= 30 || VIM_SIZEOF_INT < VIM_SIZEOF_LONG
440 static long (*dll_rb_fix2int) (VALUE); 440 static long (*dll_rb_fix2int) (VALUE);
441 static long (*dll_rb_num2int) (VALUE); 441 static long (*dll_rb_num2int) (VALUE);
442 static unsigned long (*dll_rb_num2uint) (VALUE); 442 static unsigned long (*dll_rb_num2uint) (VALUE);
443 # endif 443 # endif
444 static double (*dll_rb_num2dbl) (VALUE); 444 static double (*dll_rb_num2dbl) (VALUE);
522 static void (*dll_rb_gc_writebarrier_unprotect)(VALUE obj); 522 static void (*dll_rb_gc_writebarrier_unprotect)(VALUE obj);
523 # endif 523 # endif
524 # endif 524 # endif
525 525
526 # if RUBY_VERSION >= 30 526 # if RUBY_VERSION >= 30
527 # ifdef _MSC_VER
528 static void (*dll_ruby_malloc_size_overflow)(size_t, size_t);
529 # else
527 NORETURN(static void (*dll_ruby_malloc_size_overflow)(size_t, size_t)); 530 NORETURN(static void (*dll_ruby_malloc_size_overflow)(size_t, size_t));
531 # endif
528 # endif 532 # endif
529 533
530 # if RUBY_VERSION >= 26 534 # if RUBY_VERSION >= 26
531 void rb_ary_detransient_stub(VALUE x); 535 void rb_ary_detransient_stub(VALUE x);
532 # endif 536 # endif
552 rb_int2big_stub(SIGNED_VALUE x) 556 rb_int2big_stub(SIGNED_VALUE x)
553 # endif 557 # endif
554 { 558 {
555 return dll_rb_int2big(x); 559 return dll_rb_int2big(x);
556 } 560 }
557 # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG 561 # if RUBY_VERSION >= 30 || VIM_SIZEOF_INT < VIM_SIZEOF_LONG
558 long 562 long
559 rb_fix2int_stub(VALUE x) 563 rb_fix2int_stub(VALUE x)
560 { 564 {
561 return dll_rb_fix2int(x); 565 return dll_rb_fix2int(x);
562 } 566 }
610 void 614 void
611 rb_check_type_stub(VALUE obj, int t) 615 rb_check_type_stub(VALUE obj, int t)
612 { 616 {
613 dll_rb_check_type(obj, t); 617 dll_rb_check_type(obj, t);
614 } 618 }
615 # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG // 64 bits only
616 unsigned long 619 unsigned long
617 rb_num2uint_stub(VALUE x) 620 rb_num2uint_stub(VALUE x)
618 { 621 {
619 return dll_rb_num2uint(x); 622 return dll_rb_num2uint(x);
620 } 623 }
621 # endif
622 void 624 void
623 ruby_malloc_size_overflow_stub(size_t x, size_t y) 625 ruby_malloc_size_overflow_stub(size_t x, size_t y)
624 { 626 {
625 dll_ruby_malloc_size_overflow(x, y); 627 dll_ruby_malloc_size_overflow(x, y);
626 } 628 }
693 {"rb_hash_foreach", (RUBY_PROC*)&dll_rb_hash_foreach}, 695 {"rb_hash_foreach", (RUBY_PROC*)&dll_rb_hash_foreach},
694 {"rb_hash_new", (RUBY_PROC*)&dll_rb_hash_new}, 696 {"rb_hash_new", (RUBY_PROC*)&dll_rb_hash_new},
695 {"rb_inspect", (RUBY_PROC*)&dll_rb_inspect}, 697 {"rb_inspect", (RUBY_PROC*)&dll_rb_inspect},
696 {"rb_int2inum", (RUBY_PROC*)&dll_rb_int2inum}, 698 {"rb_int2inum", (RUBY_PROC*)&dll_rb_int2inum},
697 {"rb_intern", (RUBY_PROC*)&dll_rb_intern}, 699 {"rb_intern", (RUBY_PROC*)&dll_rb_intern},
698 # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG // 64 bits only 700 # if RUBY_VERSION >= 30 || VIM_SIZEOF_INT < VIM_SIZEOF_LONG
699 {"rb_fix2int", (RUBY_PROC*)&dll_rb_fix2int}, 701 {"rb_fix2int", (RUBY_PROC*)&dll_rb_fix2int},
700 {"rb_num2int", (RUBY_PROC*)&dll_rb_num2int}, 702 {"rb_num2int", (RUBY_PROC*)&dll_rb_num2int},
701 {"rb_num2uint", (RUBY_PROC*)&dll_rb_num2uint}, 703 {"rb_num2uint", (RUBY_PROC*)&dll_rb_num2uint},
702 # endif 704 # endif
703 {"rb_num2dbl", (RUBY_PROC*)&dll_rb_num2dbl}, 705 {"rb_num2dbl", (RUBY_PROC*)&dll_rb_num2dbl},