diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-06 21:11:31 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-06 21:11:31 +0100 |
commit | d5a986f460019a924627d79350552f446505cffb (patch) | |
tree | 96feeb0596dd12fbbd41a0abe6d2a1e949e8c46f /src | |
parent | 41d6196e302af5f1a99aeeac587b5c662c410166 (diff) |
patch 8.2.2104: build problem with Ruby 2.7v8.2.2104
Problem: Build problem with Ruby 2.7.
Solution: Adjust function declarations. (Ozaki Kiichi, closes #7430)
Diffstat (limited to 'src')
-rwxr-xr-x | src/auto/configure | 3 | ||||
-rw-r--r-- | src/configure.ac | 3 | ||||
-rw-r--r-- | src/if_ruby.c | 28 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 24 insertions, 12 deletions
diff --git a/src/auto/configure b/src/auto/configure index 205312a3bd..ef1acd848d 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -7617,8 +7617,7 @@ $as_echo "$rubyhdrdir" >&6; } librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBYARG'])"` librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBY_A'])"` rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['libdir'])"` - if test -f "$rubylibdir/$librubya"; then - librubyarg="$librubyarg" + if test -f "$rubylibdir/$librubya" || expr "$librubyarg" : "-lruby"; then RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" elif test "$librubyarg" = "libruby.a"; then librubyarg="-lruby" diff --git a/src/configure.ac b/src/configure.ac index 4b6794a29e..062c75a20a 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -1965,8 +1965,7 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"` librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"` rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"` - if test -f "$rubylibdir/$librubya"; then - librubyarg="$librubyarg" + if test -f "$rubylibdir/$librubya" || expr "$librubyarg" : "-lruby"; then RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" elif test "$librubyarg" = "libruby.a"; then dnl required on Mac OS 10.3 where libruby.a doesn't exist diff --git a/src/if_ruby.c b/src/if_ruby.c index 692af4cb2e..1619205e31 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -1300,13 +1300,19 @@ vim_blob(VALUE self UNUSED, VALUE str) } static VALUE -buffer_s_current(void) +buffer_s_current(VALUE self UNUSED) { return buffer_new(curbuf); } static VALUE -buffer_s_count(void) +buffer_s_current_getter(ID id UNUSED, VALUE *x UNUSED) +{ + return buffer_new(curbuf); +} + + static VALUE +buffer_s_count(VALUE self UNUSED) { buf_T *b; int n = 0; @@ -1566,7 +1572,13 @@ get_win(VALUE obj) } static VALUE -window_s_current(void) +window_s_current(VALUE self UNUSED) +{ + return window_new(curwin); +} + + static VALUE +window_s_current_getter(ID id UNUSED, VALUE *x UNUSED) { return window_new(curwin); } @@ -1576,7 +1588,7 @@ window_s_current(void) * SegPhault - 03/07/05 */ static VALUE -line_s_current(void) +line_s_current(VALUE self UNUSED) { return get_buffer_line(curbuf, curwin->w_cursor.lnum); } @@ -1588,13 +1600,13 @@ set_current_line(VALUE self UNUSED, VALUE str) } static VALUE -current_line_number(void) +current_line_number(VALUE self UNUSED) { return INT2FIX((int)curwin->w_cursor.lnum); } static VALUE -window_s_count(void) +window_s_count(VALUE self UNUSED) { win_T *w; int n = 0; @@ -1794,8 +1806,8 @@ ruby_vim_init(void) rb_define_method(cVimWindow, "cursor", window_cursor, 0); rb_define_method(cVimWindow, "cursor=", window_set_cursor, 1); - rb_define_virtual_variable("$curbuf", buffer_s_current, 0); - rb_define_virtual_variable("$curwin", window_s_current, 0); + rb_define_virtual_variable("$curbuf", buffer_s_current_getter, 0); + rb_define_virtual_variable("$curwin", window_s_current_getter, 0); } void diff --git a/src/version.c b/src/version.c index 2444f0bda5..08594a5625 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2104, +/**/ 2103, /**/ 2102, |