Mercurial > vim
comparison src/if_ruby.c @ 23116:55f8b7da27f3 v8.2.2104
patch 8.2.2104: build problem with Ruby 2.7
Commit: https://github.com/vim/vim/commit/d5a986f460019a924627d79350552f446505cffb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 6 21:11:31 2020 +0100
patch 8.2.2104: build problem with Ruby 2.7
Problem: Build problem with Ruby 2.7.
Solution: Adjust function declarations. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/7430)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Dec 2020 21:15:05 +0100 |
parents | 9064044fd4f6 |
children | 19575087e859 |
comparison
equal
deleted
inserted
replaced
23115:dd0da8e5bf43 | 23116:55f8b7da27f3 |
---|---|
1298 } | 1298 } |
1299 return result; | 1299 return result; |
1300 } | 1300 } |
1301 | 1301 |
1302 static VALUE | 1302 static VALUE |
1303 buffer_s_current(void) | 1303 buffer_s_current(VALUE self UNUSED) |
1304 { | 1304 { |
1305 return buffer_new(curbuf); | 1305 return buffer_new(curbuf); |
1306 } | 1306 } |
1307 | 1307 |
1308 static VALUE | 1308 static VALUE |
1309 buffer_s_count(void) | 1309 buffer_s_current_getter(ID id UNUSED, VALUE *x UNUSED) |
1310 { | |
1311 return buffer_new(curbuf); | |
1312 } | |
1313 | |
1314 static VALUE | |
1315 buffer_s_count(VALUE self UNUSED) | |
1310 { | 1316 { |
1311 buf_T *b; | 1317 buf_T *b; |
1312 int n = 0; | 1318 int n = 0; |
1313 | 1319 |
1314 FOR_ALL_BUFFERS(b) | 1320 FOR_ALL_BUFFERS(b) |
1564 rb_raise(eDeletedWindowError, "attempt to refer to deleted window"); | 1570 rb_raise(eDeletedWindowError, "attempt to refer to deleted window"); |
1565 return win; | 1571 return win; |
1566 } | 1572 } |
1567 | 1573 |
1568 static VALUE | 1574 static VALUE |
1569 window_s_current(void) | 1575 window_s_current(VALUE self UNUSED) |
1576 { | |
1577 return window_new(curwin); | |
1578 } | |
1579 | |
1580 static VALUE | |
1581 window_s_current_getter(ID id UNUSED, VALUE *x UNUSED) | |
1570 { | 1582 { |
1571 return window_new(curwin); | 1583 return window_new(curwin); |
1572 } | 1584 } |
1573 | 1585 |
1574 /* | 1586 /* |
1575 * Added line manipulation functions | 1587 * Added line manipulation functions |
1576 * SegPhault - 03/07/05 | 1588 * SegPhault - 03/07/05 |
1577 */ | 1589 */ |
1578 static VALUE | 1590 static VALUE |
1579 line_s_current(void) | 1591 line_s_current(VALUE self UNUSED) |
1580 { | 1592 { |
1581 return get_buffer_line(curbuf, curwin->w_cursor.lnum); | 1593 return get_buffer_line(curbuf, curwin->w_cursor.lnum); |
1582 } | 1594 } |
1583 | 1595 |
1584 static VALUE | 1596 static VALUE |
1586 { | 1598 { |
1587 return set_buffer_line(curbuf, curwin->w_cursor.lnum, str); | 1599 return set_buffer_line(curbuf, curwin->w_cursor.lnum, str); |
1588 } | 1600 } |
1589 | 1601 |
1590 static VALUE | 1602 static VALUE |
1591 current_line_number(void) | 1603 current_line_number(VALUE self UNUSED) |
1592 { | 1604 { |
1593 return INT2FIX((int)curwin->w_cursor.lnum); | 1605 return INT2FIX((int)curwin->w_cursor.lnum); |
1594 } | 1606 } |
1595 | 1607 |
1596 static VALUE | 1608 static VALUE |
1597 window_s_count(void) | 1609 window_s_count(VALUE self UNUSED) |
1598 { | 1610 { |
1599 win_T *w; | 1611 win_T *w; |
1600 int n = 0; | 1612 int n = 0; |
1601 | 1613 |
1602 FOR_ALL_WINDOWS(w) | 1614 FOR_ALL_WINDOWS(w) |
1792 rb_define_method(cVimWindow, "width", window_width, 0); | 1804 rb_define_method(cVimWindow, "width", window_width, 0); |
1793 rb_define_method(cVimWindow, "width=", window_set_width, 1); | 1805 rb_define_method(cVimWindow, "width=", window_set_width, 1); |
1794 rb_define_method(cVimWindow, "cursor", window_cursor, 0); | 1806 rb_define_method(cVimWindow, "cursor", window_cursor, 0); |
1795 rb_define_method(cVimWindow, "cursor=", window_set_cursor, 1); | 1807 rb_define_method(cVimWindow, "cursor=", window_set_cursor, 1); |
1796 | 1808 |
1797 rb_define_virtual_variable("$curbuf", buffer_s_current, 0); | 1809 rb_define_virtual_variable("$curbuf", buffer_s_current_getter, 0); |
1798 rb_define_virtual_variable("$curwin", window_s_current, 0); | 1810 rb_define_virtual_variable("$curwin", window_s_current_getter, 0); |
1799 } | 1811 } |
1800 | 1812 |
1801 void | 1813 void |
1802 vim_ruby_init(void *stack_start) | 1814 vim_ruby_init(void *stack_start) |
1803 { | 1815 { |