summaryrefslogtreecommitdiff
path: root/src/if_ruby.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-06 21:11:31 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-06 21:11:31 +0100
commitd5a986f460019a924627d79350552f446505cffb (patch)
tree96feeb0596dd12fbbd41a0abe6d2a1e949e8c46f /src/if_ruby.c
parent41d6196e302af5f1a99aeeac587b5c662c410166 (diff)
downloadvim-git-d5a986f460019a924627d79350552f446505cffb.tar.gz
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/if_ruby.c')
-rw-r--r--src/if_ruby.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c
index 692af4cb2..1619205e3 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