To: vim_dev@googlegroups.com Subject: Patch 8.2.0100 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0100 Problem: Macros for Ruby are too complicated. Solution: Do not use DYNAMIC_RUBY_VER, use RUBY_VERSION. (Ken Takata, closes #5452) Files: src/Make_cyg_ming.mak, src/Make_mvc.mak, src/auto/configure, src/configure.ac, src/if_ruby.c *** ../vim-8.2.0099/src/Make_cyg_ming.mak 2020-01-03 19:12:05.108214944 +0100 --- src/Make_cyg_ming.mak 2020-01-07 21:29:10.309911269 +0100 *************** *** 569,579 **** CFLAGS += -DFEAT_RUBY $(RUBYINC) ifeq (yes, $(DYNAMIC_RUBY)) CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" - CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER) endif - ifeq (no, $(DYNAMIC_RUBY)) CFLAGS += -DRUBY_VERSION=$(RUBY_VER) - endif ifneq ($(findstring w64-mingw32,$(CC)),) # A workaround for MinGW-w64 CFLAGS += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE --- 569,576 ---- *** ../vim-8.2.0099/src/Make_mvc.mak 2020-01-03 19:12:05.108214944 +0100 --- src/Make_mvc.mak 2020-01-07 21:29:10.309911269 +0100 *************** *** 1193,1202 **** # Do we want to load Ruby dynamically? ! if "$(DYNAMIC_RUBY)" == "yes" ! message Ruby DLL will be loaded dynamically ! CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \ ! -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" ! undef RUBY_LIB ! endif !endif # RUBY # --- 1193,1203 ---- # Do we want to load Ruby dynamically? ! if "$(DYNAMIC_RUBY)" == "yes" ! message Ruby DLL will be loaded dynamically ! CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY \ ! -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" ! undef RUBY_LIB ! endif + CFLAGS = $(CFLAGS) -DRUBY_VERSION=$(RUBY_VER) !endif # RUBY # *** ../vim-8.2.0099/src/auto/configure 2020-01-02 22:38:45.582279104 +0100 --- src/auto/configure 2020-01-07 21:31:18.169437296 +0100 *************** *** 7622,7628 **** fi $as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h ! RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" RUBY_LIBS= fi else --- 7622,7628 ---- fi $as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h ! RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS" RUBY_LIBS= fi else *** ../vim-8.2.0099/src/configure.ac 2020-01-02 22:38:45.578279122 +0100 --- src/configure.ac 2020-01-07 21:29:10.309911269 +0100 *************** *** 1966,1972 **** libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"` fi AC_DEFINE(DYNAMIC_RUBY) ! RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" RUBY_LIBS= fi else --- 1966,1972 ---- libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"` fi AC_DEFINE(DYNAMIC_RUBY) ! RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS" RUBY_LIBS= fi else *** ../vim-8.2.0099/src/if_ruby.c 2019-12-04 21:20:37.000000000 +0100 --- src/if_ruby.c 2020-01-07 21:29:10.309911269 +0100 *************** *** 20,26 **** #include #ifdef _WIN32 ! # if !defined(DYNAMIC_RUBY_VER) || (DYNAMIC_RUBY_VER < 18) # define NT # endif # ifndef DYNAMIC_RUBY --- 20,26 ---- #include #ifdef _WIN32 ! # if !defined(DYNAMIC_RUBY) || (RUBY_VERSION < 18) # define NT # endif # ifndef DYNAMIC_RUBY *************** *** 32,38 **** # define RUBYEXTERN extern #endif ! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 24 # define USE_RUBY_INTEGER #endif --- 32,38 ---- # define RUBYEXTERN extern #endif ! #if defined(DYNAMIC_RUBY) && RUBY_VERSION >= 24 # define USE_RUBY_INTEGER #endif *************** *** 47,60 **** # if defined(USE_RUBY_INTEGER) # define rb_cInteger (*dll_rb_cInteger) # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 # define rb_cFloat (*dll_rb_cFloat) # endif # define rb_cNilClass (*dll_rb_cNilClass) # define rb_cString (*dll_rb_cString) # define rb_cSymbol (*dll_rb_cSymbol) # define rb_cTrueClass (*dll_rb_cTrueClass) ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 /* * On ver 1.8, all Ruby functions are exported with "__declspec(dllimport)" * in ruby.h. But it causes trouble for these variables, because it is --- 47,60 ---- # if defined(USE_RUBY_INTEGER) # define rb_cInteger (*dll_rb_cInteger) # endif ! # if RUBY_VERSION >= 20 # define rb_cFloat (*dll_rb_cFloat) # endif # define rb_cNilClass (*dll_rb_cNilClass) # define rb_cString (*dll_rb_cString) # define rb_cSymbol (*dll_rb_cSymbol) # define rb_cTrueClass (*dll_rb_cTrueClass) ! # if RUBY_VERSION >= 18 /* * On ver 1.8, all Ruby functions are exported with "__declspec(dllimport)" * in ruby.h. But it causes trouble for these variables, because it is *************** *** 71,99 **** # undef _WIN32_WINNT #endif ! #if (defined(RUBY_VERSION) && RUBY_VERSION >= 19) \ ! || (defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19) ! # define RUBY19_OR_LATER 1 ! #endif ! ! #if (defined(RUBY_VERSION) && RUBY_VERSION >= 20) \ ! || (defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20) ! # define RUBY20_OR_LATER 1 ! #endif ! ! #if (defined(RUBY_VERSION) && RUBY_VERSION >= 21) \ ! || (defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21) ! # define RUBY21_OR_LATER 1 ! #endif ! ! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 // Ruby 1.9 defines a number of static functions which use rb_num2long and // rb_int2big # define rb_num2long rb_num2long_stub # define rb_int2big rb_int2big_stub #endif ! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 \ && VIM_SIZEOF_INT < VIM_SIZEOF_LONG // Ruby 1.9 defines a number of static functions which use rb_fix2int and // rb_num2int if VIM_SIZEOF_INT < VIM_SIZEOF_LONG (64bit) --- 71,84 ---- # undef _WIN32_WINNT #endif ! #if defined(DYNAMIC_RUBY) && RUBY_VERSION >= 19 // Ruby 1.9 defines a number of static functions which use rb_num2long and // rb_int2big # define rb_num2long rb_num2long_stub # define rb_int2big rb_int2big_stub #endif ! #if defined(DYNAMIC_RUBY) && RUBY_VERSION >= 19 \ && VIM_SIZEOF_INT < VIM_SIZEOF_LONG // Ruby 1.9 defines a number of static functions which use rb_fix2int and // rb_num2int if VIM_SIZEOF_INT < VIM_SIZEOF_LONG (64bit) *************** *** 101,124 **** # define rb_num2int rb_num2int_stub #endif ! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21 // Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses // rb_gc_writebarrier_unprotect_promoted if USE_RGENGC # define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub #endif ! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22 # define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub #endif ! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 26 # define rb_ary_detransient rb_ary_detransient_stub #endif #include ! #ifdef RUBY19_OR_LATER # include #endif ! #ifndef RUBY19_OR_LATER # include // for ST_STOP and ST_CONTINUE #endif --- 86,109 ---- # define rb_num2int rb_num2int_stub #endif ! #if defined(DYNAMIC_RUBY) && RUBY_VERSION == 21 // Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses // rb_gc_writebarrier_unprotect_promoted if USE_RGENGC # define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub #endif ! #if defined(DYNAMIC_RUBY) && RUBY_VERSION >= 22 # define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub #endif ! #if defined(DYNAMIC_RUBY) && RUBY_VERSION >= 26 # define rb_ary_detransient rb_ary_detransient_stub #endif #include ! #if RUBY_VERSION >= 19 # include #endif ! #if RUBY_VERSION <= 18 # include // for ST_STOP and ST_CONTINUE #endif *************** *** 139,145 **** * The old Data_XXX macro family was deprecated on Ruby 2.2. * Use TypedData_XXX if available. */ ! #if defined(TypedData_Wrap_Struct) && defined(RUBY20_OR_LATER) # define USE_TYPEDDATA 1 #endif --- 124,130 ---- * The old Data_XXX macro family was deprecated on Ruby 2.2. * Use TypedData_XXX if available. */ ! #if defined(TypedData_Wrap_Struct) && (RUBY_VERSION >= 20) # define USE_TYPEDDATA 1 #endif *************** *** 210,216 **** static void ruby_vim_init(void); static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv); ! #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) # if defined(__ia64) && !defined(ruby_init_stack) # define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp()) # endif --- 195,201 ---- static void ruby_vim_init(void); static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv); ! #if (RUBY_VERSION >= 19) || defined(RUBY_INIT_STACK) # if defined(__ia64) && !defined(ruby_init_stack) # define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp()) # endif *************** *** 233,239 **** # endif # define rb_class_path dll_rb_class_path # ifdef USE_TYPEDDATA ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 23 # define rb_data_typed_object_wrap dll_rb_data_typed_object_wrap # else # define rb_data_typed_object_alloc dll_rb_data_typed_object_alloc --- 218,224 ---- # endif # define rb_class_path dll_rb_class_path # ifdef USE_TYPEDDATA ! # if RUBY_VERSION >= 23 # define rb_data_typed_object_wrap dll_rb_data_typed_object_wrap # else # define rb_data_typed_object_alloc dll_rb_data_typed_object_alloc *************** *** 256,262 **** # define rb_eRuntimeError (*dll_rb_eRuntimeError) # define rb_eStandardError (*dll_rb_eStandardError) # define rb_eval_string_protect dll_rb_eval_string_protect ! # ifdef RUBY21_OR_LATER # define rb_funcallv dll_rb_funcallv # else # define rb_funcall2 dll_rb_funcall2 --- 241,247 ---- # define rb_eRuntimeError (*dll_rb_eRuntimeError) # define rb_eStandardError (*dll_rb_eStandardError) # define rb_eval_string_protect dll_rb_eval_string_protect ! # if RUBY_VERSION >= 21 # define rb_funcallv dll_rb_funcallv # else # define rb_funcall2 dll_rb_funcall2 *************** *** 274,280 **** # define rb_intern dll_rb_intern # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG // 64 bits only ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 18 # define rb_fix2int dll_rb_fix2int # define rb_num2int dll_rb_num2int # endif --- 259,265 ---- # define rb_intern dll_rb_intern # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG // 64 bits only ! # if RUBY_VERSION <= 18 # define rb_fix2int dll_rb_fix2int # define rb_num2int dll_rb_num2int # endif *************** *** 285,294 **** # define rb_lastline_set dll_rb_lastline_set # define rb_protect dll_rb_protect # define rb_load dll_rb_load ! # ifndef RUBY19_OR_LATER # define rb_num2long dll_rb_num2long # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 19 # define rb_num2ulong dll_rb_num2ulong # endif # define rb_obj_alloc dll_rb_obj_alloc --- 270,279 ---- # define rb_lastline_set dll_rb_lastline_set # define rb_protect dll_rb_protect # define rb_load dll_rb_load ! # if RUBY_VERSION <= 18 # define rb_num2long dll_rb_num2long # endif ! # if RUBY_VERSION <= 19 # define rb_num2ulong dll_rb_num2ulong # endif # define rb_obj_alloc dll_rb_obj_alloc *************** *** 309,315 **** # else # define rb_str_new2 dll_rb_str_new2 # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 # define rb_string_value dll_rb_string_value # define rb_string_value_ptr dll_rb_string_value_ptr # define rb_float_new dll_rb_float_new --- 294,300 ---- # else # define rb_str_new2 dll_rb_str_new2 # endif ! # if RUBY_VERSION >= 18 # define rb_string_value dll_rb_string_value # define rb_string_value_ptr dll_rb_string_value_ptr # define rb_float_new dll_rb_float_new *************** *** 320,326 **** # endif # define rb_ary_new4 dll_rb_ary_new4 # define rb_ary_push dll_rb_ary_push ! # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) # ifdef __ia64 # define rb_ia64_bsp dll_rb_ia64_bsp # undef ruby_init_stack --- 305,311 ---- # endif # define rb_ary_new4 dll_rb_ary_new4 # define rb_ary_push dll_rb_ary_push ! # if (RUBY_VERSION >= 19) || defined(RUBY_INIT_STACK) # ifdef __ia64 # define rb_ia64_bsp dll_rb_ia64_bsp # undef ruby_init_stack *************** *** 332,338 **** # else # define rb_str2cstr dll_rb_str2cstr # endif ! # ifdef RUBY19_OR_LATER # define rb_errinfo dll_rb_errinfo # else # define ruby_errinfo (*dll_ruby_errinfo) --- 317,323 ---- # else # define rb_str2cstr dll_rb_str2cstr # endif ! # if RUBY_VERSION >= 19 # define rb_errinfo dll_rb_errinfo # else # define ruby_errinfo (*dll_ruby_errinfo) *************** *** 340,356 **** # define ruby_init dll_ruby_init # define ruby_init_loadpath dll_ruby_init_loadpath # ifdef MSWIN ! # ifdef RUBY19_OR_LATER # define ruby_sysinit dll_ruby_sysinit # else # define NtInitialize dll_NtInitialize # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 # define rb_w32_snprintf dll_rb_w32_snprintf # endif # endif ! # ifdef RUBY19_OR_LATER # define ruby_script dll_ruby_script # define rb_enc_find_index dll_rb_enc_find_index # define rb_enc_find dll_rb_enc_find --- 325,341 ---- # define ruby_init dll_ruby_init # define ruby_init_loadpath dll_ruby_init_loadpath # ifdef MSWIN ! # if RUBY_VERSION >= 19 # define ruby_sysinit dll_ruby_sysinit # else # define NtInitialize dll_NtInitialize # endif ! # if RUBY_VERSION >= 18 # define rb_w32_snprintf dll_rb_w32_snprintf # endif # endif ! # if RUBY_VERSION >= 19 # define ruby_script dll_ruby_script # define rb_enc_find_index dll_rb_enc_find_index # define rb_enc_find dll_rb_enc_find *************** *** 370,376 **** # if defined(USE_RUBY_INTEGER) VALUE *dll_rb_cInteger; # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 VALUE *dll_rb_cFloat; # endif VALUE *dll_rb_cNilClass; --- 355,361 ---- # if defined(USE_RUBY_INTEGER) VALUE *dll_rb_cInteger; # endif ! # if RUBY_VERSION >= 20 VALUE *dll_rb_cFloat; # endif VALUE *dll_rb_cNilClass; *************** *** 385,391 **** # endif static VALUE (*dll_rb_class_path) (VALUE); # ifdef USE_TYPEDDATA ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 23 static VALUE (*dll_rb_data_typed_object_wrap) (VALUE, void*, const rb_data_type_t *); # else static VALUE (*dll_rb_data_typed_object_alloc) (VALUE, void*, const rb_data_type_t *); --- 370,376 ---- # endif static VALUE (*dll_rb_class_path) (VALUE); # ifdef USE_TYPEDDATA ! # if RUBY_VERSION >= 23 static VALUE (*dll_rb_data_typed_object_wrap) (VALUE, void*, const rb_data_type_t *); # else static VALUE (*dll_rb_data_typed_object_alloc) (VALUE, void*, const rb_data_type_t *); *************** *** 408,414 **** static VALUE *dll_rb_eRuntimeError; static VALUE *dll_rb_eStandardError; static VALUE (*dll_rb_eval_string_protect) (const char*, int*); ! # ifdef RUBY21_OR_LATER static VALUE (*dll_rb_funcallv) (VALUE, ID, int, const VALUE*); # else static VALUE (*dll_rb_funcall2) (VALUE, ID, int, const VALUE*); --- 393,399 ---- static VALUE *dll_rb_eRuntimeError; static VALUE *dll_rb_eStandardError; static VALUE (*dll_rb_eval_string_protect) (const char*, int*); ! # if RUBY_VERSION >= 21 static VALUE (*dll_rb_funcallv) (VALUE, ID, int, const VALUE*); # else static VALUE (*dll_rb_funcall2) (VALUE, ID, int, const VALUE*); *************** *** 436,442 **** static VALUE (*dll_rb_obj_as_string) (VALUE); static VALUE (*dll_rb_obj_id) (VALUE); static void (*dll_rb_raise) (VALUE, const char*, ...); ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 static VALUE (*dll_rb_string_value) (volatile VALUE*); # else static char *(*dll_rb_str2cstr) (VALUE,int*); --- 421,427 ---- static VALUE (*dll_rb_obj_as_string) (VALUE); static VALUE (*dll_rb_obj_id) (VALUE); static void (*dll_rb_raise) (VALUE, const char*, ...); ! # if RUBY_VERSION >= 18 static VALUE (*dll_rb_string_value) (volatile VALUE*); # else static char *(*dll_rb_str2cstr) (VALUE,int*); *************** *** 450,456 **** # else static VALUE (*dll_rb_str_new2) (const char*); # endif ! # ifdef RUBY19_OR_LATER static VALUE (*dll_rb_errinfo) (void); # else static VALUE *dll_ruby_errinfo; --- 435,441 ---- # else static VALUE (*dll_rb_str_new2) (const char*); # endif ! # if RUBY_VERSION >= 19 static VALUE (*dll_rb_errinfo) (void); # else static VALUE *dll_ruby_errinfo; *************** *** 458,482 **** static void (*dll_ruby_init) (void); static void (*dll_ruby_init_loadpath) (void); # ifdef MSWIN ! # ifdef RUBY19_OR_LATER static void (*dll_ruby_sysinit) (int*, char***); # else static void (*dll_NtInitialize) (int*, char***); # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); # endif # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 static char * (*dll_rb_string_value_ptr) (volatile VALUE*); static VALUE (*dll_rb_float_new) (double); static VALUE (*dll_rb_ary_new) (void); static VALUE (*dll_rb_ary_new4) (long n, const VALUE *elts); static VALUE (*dll_rb_ary_push) (VALUE, VALUE); ! # if DYNAMIC_RUBY_VER >= 26 static void (*dll_rb_ary_detransient) (VALUE); # endif ! # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) # ifdef __ia64 static void * (*dll_rb_ia64_bsp) (void); static void (*dll_ruby_init_stack)(VALUE*, void*); --- 443,467 ---- static void (*dll_ruby_init) (void); static void (*dll_ruby_init_loadpath) (void); # ifdef MSWIN ! # if RUBY_VERSION >= 19 static void (*dll_ruby_sysinit) (int*, char***); # else static void (*dll_NtInitialize) (int*, char***); # endif ! # if RUBY_VERSION >= 18 static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); # endif # endif ! # if RUBY_VERSION >= 18 static char * (*dll_rb_string_value_ptr) (volatile VALUE*); static VALUE (*dll_rb_float_new) (double); static VALUE (*dll_rb_ary_new) (void); static VALUE (*dll_rb_ary_new4) (long n, const VALUE *elts); static VALUE (*dll_rb_ary_push) (VALUE, VALUE); ! # if RUBY_VERSION >= 26 static void (*dll_rb_ary_detransient) (VALUE); # endif ! # if (RUBY_VERSION >= 19) || defined(RUBY_INIT_STACK) # ifdef __ia64 static void * (*dll_rb_ia64_bsp) (void); static void (*dll_ruby_init_stack)(VALUE*, void*); *************** *** 485,495 **** # endif # endif # endif ! # ifdef RUBY19_OR_LATER static VALUE (*dll_rb_int2big)(SIGNED_VALUE); # endif ! # ifdef RUBY19_OR_LATER static void (*dll_ruby_script) (const char*); static int (*dll_rb_enc_find_index) (const char*); static rb_encoding* (*dll_rb_enc_find) (const char*); --- 470,480 ---- # endif # endif # endif ! # if RUBY_VERSION >= 19 static VALUE (*dll_rb_int2big)(SIGNED_VALUE); # endif ! # if RUBY_VERSION >= 19 static void (*dll_ruby_script) (const char*); static int (*dll_rb_enc_find_index) (const char*); static rb_encoding* (*dll_rb_enc_find) (const char*); *************** *** 500,514 **** # endif # if defined(USE_RGENGC) && USE_RGENGC ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21 static void (*dll_rb_gc_writebarrier_unprotect_promoted)(VALUE); # else static void (*dll_rb_gc_writebarrier_unprotect)(VALUE obj); # endif # endif ! # if defined(RUBY19_OR_LATER) && !defined(PROTO) ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22 long rb_num2long_stub(VALUE x) # else --- 485,499 ---- # endif # if defined(USE_RGENGC) && USE_RGENGC ! # if RUBY_VERSION == 21 static void (*dll_rb_gc_writebarrier_unprotect_promoted)(VALUE); # else static void (*dll_rb_gc_writebarrier_unprotect)(VALUE obj); # endif # endif ! # if (RUBY_VERSION >= 19) && !defined(PROTO) ! # if RUBY_VERSION >= 22 long rb_num2long_stub(VALUE x) # else *************** *** 518,524 **** { return dll_rb_num2long(x); } ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 26 VALUE rb_int2big_stub(intptr_t x) # else --- 503,509 ---- { return dll_rb_num2long(x); } ! # if RUBY_VERSION >= 26 VALUE rb_int2big_stub(intptr_t x) # else *************** *** 528,535 **** { return dll_rb_int2big(x); } ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 \ ! && VIM_SIZEOF_INT < VIM_SIZEOF_LONG long rb_fix2int_stub(VALUE x) { --- 513,519 ---- { return dll_rb_int2big(x); } ! # if (RUBY_VERSION >= 19) && (VIM_SIZEOF_INT < VIM_SIZEOF_LONG) long rb_fix2int_stub(VALUE x) { *************** *** 541,553 **** return dll_rb_num2int(x); } # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 VALUE rb_float_new_in_heap(double d) { return dll_rb_float_new(d); } ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22 unsigned long rb_num2ulong(VALUE x) # else --- 525,537 ---- return dll_rb_num2int(x); } # endif ! # if RUBY_VERSION >= 20 VALUE rb_float_new_in_heap(double d) { return dll_rb_float_new(d); } ! # if RUBY_VERSION >= 22 unsigned long rb_num2ulong(VALUE x) # else *************** *** 562,568 **** // Do not generate a prototype here, VALUE isn't always defined. # if defined(USE_RGENGC) && USE_RGENGC && !defined(PROTO) ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21 void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj) { --- 546,552 ---- // Do not generate a prototype here, VALUE isn't always defined. # if defined(USE_RGENGC) && USE_RGENGC && !defined(PROTO) ! # if RUBY_VERSION == 21 void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj) { *************** *** 577,583 **** # endif # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 26 void rb_ary_detransient_stub(VALUE x) { --- 561,567 ---- # endif # endif ! # if RUBY_VERSION >= 26 void rb_ary_detransient_stub(VALUE x) { *************** *** 603,609 **** # else {"rb_cFixnum", (RUBY_PROC*)&dll_rb_cFixnum}, # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 {"rb_cFloat", (RUBY_PROC*)&dll_rb_cFloat}, # endif {"rb_cNilClass", (RUBY_PROC*)&dll_rb_cNilClass}, --- 587,593 ---- # else {"rb_cFixnum", (RUBY_PROC*)&dll_rb_cFixnum}, # endif ! # if RUBY_VERSION >= 20 {"rb_cFloat", (RUBY_PROC*)&dll_rb_cFloat}, # endif {"rb_cNilClass", (RUBY_PROC*)&dll_rb_cNilClass}, *************** *** 618,624 **** # endif {"rb_class_path", (RUBY_PROC*)&dll_rb_class_path}, # ifdef USE_TYPEDDATA ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 23 {"rb_data_typed_object_wrap", (RUBY_PROC*)&dll_rb_data_typed_object_wrap}, # else {"rb_data_typed_object_alloc", (RUBY_PROC*)&dll_rb_data_typed_object_alloc}, --- 602,608 ---- # endif {"rb_class_path", (RUBY_PROC*)&dll_rb_class_path}, # ifdef USE_TYPEDDATA ! # if RUBY_VERSION >= 23 {"rb_data_typed_object_wrap", (RUBY_PROC*)&dll_rb_data_typed_object_wrap}, # else {"rb_data_typed_object_alloc", (RUBY_PROC*)&dll_rb_data_typed_object_alloc}, *************** *** 641,647 **** {"rb_eRuntimeError", (RUBY_PROC*)&dll_rb_eRuntimeError}, {"rb_eStandardError", (RUBY_PROC*)&dll_rb_eStandardError}, {"rb_eval_string_protect", (RUBY_PROC*)&dll_rb_eval_string_protect}, ! # ifdef RUBY21_OR_LATER {"rb_funcallv", (RUBY_PROC*)&dll_rb_funcallv}, # else {"rb_funcall2", (RUBY_PROC*)&dll_rb_funcall2}, --- 625,631 ---- {"rb_eRuntimeError", (RUBY_PROC*)&dll_rb_eRuntimeError}, {"rb_eStandardError", (RUBY_PROC*)&dll_rb_eStandardError}, {"rb_eval_string_protect", (RUBY_PROC*)&dll_rb_eval_string_protect}, ! # if RUBY_VERSION >= 21 {"rb_funcallv", (RUBY_PROC*)&dll_rb_funcallv}, # else {"rb_funcall2", (RUBY_PROC*)&dll_rb_funcall2}, *************** *** 669,675 **** {"rb_obj_as_string", (RUBY_PROC*)&dll_rb_obj_as_string}, {"rb_obj_id", (RUBY_PROC*)&dll_rb_obj_id}, {"rb_raise", (RUBY_PROC*)&dll_rb_raise}, ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 {"rb_string_value", (RUBY_PROC*)&dll_rb_string_value}, # else {"rb_str2cstr", (RUBY_PROC*)&dll_rb_str2cstr}, --- 653,659 ---- {"rb_obj_as_string", (RUBY_PROC*)&dll_rb_obj_as_string}, {"rb_obj_id", (RUBY_PROC*)&dll_rb_obj_id}, {"rb_raise", (RUBY_PROC*)&dll_rb_raise}, ! # if RUBY_VERSION >= 18 {"rb_string_value", (RUBY_PROC*)&dll_rb_string_value}, # else {"rb_str2cstr", (RUBY_PROC*)&dll_rb_str2cstr}, *************** *** 682,688 **** # else {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, # endif ! # ifdef RUBY19_OR_LATER {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, # else {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, --- 666,672 ---- # else {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, # endif ! # if RUBY_VERSION >= 19 {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, # else {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, *************** *** 690,707 **** {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, # ifdef MSWIN ! # ifdef RUBY19_OR_LATER {"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit}, # else {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize}, # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, # endif # endif ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, ! # if DYNAMIC_RUBY_VER <= 19 {"rb_float_new", (RUBY_PROC*)&dll_rb_float_new}, # else {"rb_float_new_in_heap", (RUBY_PROC*)&dll_rb_float_new}, --- 674,691 ---- {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, # ifdef MSWIN ! # if RUBY_VERSION >= 19 {"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit}, # else {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize}, # endif ! # if RUBY_VERSION >= 18 {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, # endif # endif ! # if RUBY_VERSION >= 18 {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, ! # if RUBY_VERSION <= 19 {"rb_float_new", (RUBY_PROC*)&dll_rb_float_new}, # else {"rb_float_new_in_heap", (RUBY_PROC*)&dll_rb_float_new}, *************** *** 713,723 **** {"rb_ary_new4", (RUBY_PROC*)&dll_rb_ary_new4}, # endif {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, ! # if DYNAMIC_RUBY_VER >= 26 {"rb_ary_detransient", (RUBY_PROC*)&dll_rb_ary_detransient}, # endif # endif ! # ifdef RUBY19_OR_LATER {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, --- 697,707 ---- {"rb_ary_new4", (RUBY_PROC*)&dll_rb_ary_new4}, # endif {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, ! # if RUBY_VERSION >= 26 {"rb_ary_detransient", (RUBY_PROC*)&dll_rb_ary_detransient}, # endif # endif ! # if RUBY_VERSION >= 19 {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, *************** *** 727,740 **** {"rb_require", (RUBY_PROC*)&dll_rb_require}, {"ruby_options", (RUBY_PROC*)&dll_ruby_options}, # endif ! # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) # ifdef __ia64 {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp}, # endif {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, # endif # if defined(USE_RGENGC) && USE_RGENGC ! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21 {"rb_gc_writebarrier_unprotect_promoted", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect_promoted}, # else {"rb_gc_writebarrier_unprotect", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect}, --- 711,724 ---- {"rb_require", (RUBY_PROC*)&dll_rb_require}, {"ruby_options", (RUBY_PROC*)&dll_ruby_options}, # endif ! # if (RUBY_VERSION >= 19) || defined(RUBY_INIT_STACK) # ifdef __ia64 {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp}, # endif {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, # endif # if defined(USE_RGENGC) && USE_RGENGC ! # if RUBY_VERSION == 21 {"rb_gc_writebarrier_unprotect_promoted", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect_promoted}, # else {"rb_gc_writebarrier_unprotect", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect}, *************** *** 837,843 **** static VALUE vim_str2rb_enc_str(const char *s) { ! #ifdef RUBY19_OR_LATER int isnum; long lval; char_u *sval; --- 821,827 ---- static VALUE vim_str2rb_enc_str(const char *s) { ! #if RUBY_VERSION >= 19 int isnum; long lval; char_u *sval; *************** *** 858,864 **** static VALUE eval_enc_string_protect(const char *str, int *state) { ! #ifdef RUBY19_OR_LATER int isnum; long lval; char_u *sval; --- 842,848 ---- static VALUE eval_enc_string_protect(const char *str, int *state) { ! #if RUBY_VERSION >= 19 int isnum; long lval; char_u *sval; *************** *** 982,1000 **** int argc = 1; char *argv[] = {"gvim.exe"}; char **argvp = argv; ! # ifdef RUBY19_OR_LATER ruby_sysinit(&argc, &argvp); # else NtInitialize(&argc, &argvp); # endif #endif { ! #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) ruby_init_stack(ruby_stack_start); #endif ruby_init(); } ! #ifdef RUBY19_OR_LATER { int dummy_argc = 2; char *dummy_argv[] = {"vim-ruby", "-e_=0"}; --- 966,984 ---- int argc = 1; char *argv[] = {"gvim.exe"}; char **argvp = argv; ! # if RUBY_VERSION >= 19 ruby_sysinit(&argc, &argvp); # else NtInitialize(&argc, &argvp); # endif #endif { ! #if (RUBY_VERSION >= 19) || defined(RUBY_INIT_STACK) ruby_init_stack(ruby_stack_start); #endif ruby_init(); } ! #if RUBY_VERSION >= 19 { int dummy_argc = 2; char *dummy_argv[] = {"vim-ruby", "-e_=0"}; *************** *** 1022,1028 **** static void error_print(int state) { ! #if !defined(DYNAMIC_RUBY) && !defined(RUBY19_OR_LATER) RUBYEXTERN VALUE ruby_errinfo; #endif VALUE error; --- 1006,1012 ---- static void error_print(int state) { ! #if !defined(DYNAMIC_RUBY) && (RUBY_VERSION <= 18) RUBYEXTERN VALUE ruby_errinfo; #endif VALUE error; *************** *** 1062,1068 **** break; case TAG_RAISE: case TAG_FATAL: ! #ifdef RUBY19_OR_LATER error = rb_errinfo(); #else error = ruby_errinfo; --- 1046,1052 ---- break; case TAG_RAISE: case TAG_FATAL: ! #if RUBY_VERSION >= 19 error = rb_errinfo(); #else error = ruby_errinfo; *************** *** 1087,1093 **** } attr = syn_name2attr((char_u *)"Error"); ! # ifdef RUBY21_OR_LATER bt = rb_funcallv(error, rb_intern("backtrace"), 0, 0); for (i = 0; i < RARRAY_LEN(bt); i++) msg_attr(RSTRING_PTR(RARRAY_AREF(bt, i)), attr); --- 1071,1077 ---- } attr = syn_name2attr((char_u *)"Error"); ! # if RUBY_VERSION >= 21 bt = rb_funcallv(error, rb_intern("backtrace"), 0, 0); for (i = 0; i < RARRAY_LEN(bt); i++) msg_attr(RSTRING_PTR(RARRAY_AREF(bt, i)), attr); *************** *** 1242,1248 **** static const rb_data_type_t buffer_type = { "vim_buffer", ! {0, 0, buffer_dsize, {0, 0}}, 0, 0, # ifdef RUBY_TYPED_FREE_IMMEDIATELY 0, --- 1226,1238 ---- static const rb_data_type_t buffer_type = { "vim_buffer", ! {0, 0, buffer_dsize, ! # if RUBY_VERSION >= 27 ! 0, 0 ! # else ! {0, 0} ! # endif ! }, 0, 0, # ifdef RUBY_TYPED_FREE_IMMEDIATELY 0, *************** *** 1516,1522 **** static const rb_data_type_t window_type = { "vim_window", ! {0, 0, window_dsize, {0, 0}}, 0, 0, # ifdef RUBY_TYPED_FREE_IMMEDIATELY 0, --- 1506,1518 ---- static const rb_data_type_t window_type = { "vim_window", ! {0, 0, window_dsize, ! # if RUBY_VERSION >= 27 ! 0, 0 ! # else ! {0, 0} ! # endif ! }, 0, 0, # ifdef RUBY_TYPED_FREE_IMMEDIATELY 0, *** ../vim-8.2.0099/src/version.c 2020-01-07 21:05:45.627365256 +0100 --- src/version.c 2020-01-07 21:30:56.941509522 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 100, /**/ -- Kisses may last for as much as, but no more than, five minutes. [real standing law in Iowa, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///