Mercurial > vim
comparison src/if_ruby.c @ 15275:b408509d8292 v8.1.0646
patch 8.1.0646: cannot build with Ruby 2.6.0
commit https://github.com/vim/vim/commit/b09c684195d803137d52c34fb4d3a410be5ac10f
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 27 22:11:01 2018 +0100
patch 8.1.0646: cannot build with Ruby 2.6.0
Problem: Cannot build with Ruby 2.6.0.
Solution: Add rb_ary_detransient(). (Ozaki Kiichi, closes https://github.com/vim/vim/issues/3724)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 27 Dec 2018 22:15:04 +0100 |
parents | 1e98b81ff9ee |
children | 0807e2dbbab6 |
comparison
equal
deleted
inserted
replaced
15274:f47e56455015 | 15275:b408509d8292 |
---|---|
119 * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC */ | 119 * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC */ |
120 # define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub | 120 # define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub |
121 #endif | 121 #endif |
122 #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22 | 122 #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22 |
123 # define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub | 123 # define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub |
124 #endif | |
125 | |
126 #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 26 | |
127 # define rb_ary_detransient (*dll_rb_ary_detransient) | |
124 #endif | 128 #endif |
125 | 129 |
126 #include <ruby.h> | 130 #include <ruby.h> |
127 #ifdef RUBY19_OR_LATER | 131 #ifdef RUBY19_OR_LATER |
128 # include <ruby/encoding.h> | 132 # include <ruby/encoding.h> |
453 static char * (*dll_rb_string_value_ptr) (volatile VALUE*); | 457 static char * (*dll_rb_string_value_ptr) (volatile VALUE*); |
454 static VALUE (*dll_rb_float_new) (double); | 458 static VALUE (*dll_rb_float_new) (double); |
455 static VALUE (*dll_rb_ary_new) (void); | 459 static VALUE (*dll_rb_ary_new) (void); |
456 static VALUE (*dll_rb_ary_new4) (long n, const VALUE *elts); | 460 static VALUE (*dll_rb_ary_new4) (long n, const VALUE *elts); |
457 static VALUE (*dll_rb_ary_push) (VALUE, VALUE); | 461 static VALUE (*dll_rb_ary_push) (VALUE, VALUE); |
462 # if DYNAMIC_RUBY_VER >= 26 | |
463 static void (*dll_rb_ary_detransient) (VALUE); | |
464 # endif | |
458 # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) | 465 # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) |
459 # ifdef __ia64 | 466 # ifdef __ia64 |
460 static void * (*dll_rb_ia64_bsp) (void); | 467 static void * (*dll_rb_ia64_bsp) (void); |
461 static void (*dll_ruby_init_stack)(VALUE*, void*); | 468 static void (*dll_ruby_init_stack)(VALUE*, void*); |
462 # else | 469 # else |
664 {"rb_ary_new_from_values", (RUBY_PROC*)&dll_rb_ary_new4}, | 671 {"rb_ary_new_from_values", (RUBY_PROC*)&dll_rb_ary_new4}, |
665 # else | 672 # else |
666 {"rb_ary_new4", (RUBY_PROC*)&dll_rb_ary_new4}, | 673 {"rb_ary_new4", (RUBY_PROC*)&dll_rb_ary_new4}, |
667 # endif | 674 # endif |
668 {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, | 675 {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, |
676 # if DYNAMIC_RUBY_VER >= 26 | |
677 {"rb_ary_detransient", (RUBY_PROC*)&dll_rb_ary_detransient}, | |
678 # endif | |
669 # endif | 679 # endif |
670 # ifdef RUBY19_OR_LATER | 680 # ifdef RUBY19_OR_LATER |
671 {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, | 681 {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, |
672 {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, | 682 {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, |
673 {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, | 683 {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, |
964 return ruby_initialized; | 974 return ruby_initialized; |
965 } | 975 } |
966 | 976 |
967 static void error_print(int state) | 977 static void error_print(int state) |
968 { | 978 { |
969 #ifndef DYNAMIC_RUBY | 979 #if !defined(DYNAMIC_RUBY) && !defined(RUBY19_OR_LATER) |
970 #if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19) \ | |
971 && !(defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19) | |
972 RUBYEXTERN VALUE ruby_errinfo; | 980 RUBYEXTERN VALUE ruby_errinfo; |
973 #endif | |
974 #endif | 981 #endif |
975 VALUE error; | 982 VALUE error; |
976 VALUE eclass; | 983 VALUE eclass; |
977 VALUE einfo; | 984 VALUE einfo; |
978 VALUE bt; | 985 VALUE bt; |