Skip to content

Commit 8b430b4

Browse files
committed
patch 8.2.0297: compiler warnings for the Ruby interface
Problem: Compiler warnings for the Ruby interface. Solution: Undefine a few macros, fix initialization. (Ozaki Kiichi, closes #5677)
1 parent f9706e9 commit 8b430b4

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/if_ruby.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,14 @@ static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv);
209209
/*
210210
* Wrapper defines
211211
*/
212+
// Ruby 2.7 actually expands the following symbols as macro.
213+
# if RUBY_VERSION >= 27
214+
# undef rb_define_global_function
215+
# undef rb_define_method
216+
# undef rb_define_module_function
217+
# undef rb_define_singleton_method
218+
# endif
219+
212220
# define rb_assoc_new dll_rb_assoc_new
213221
# define rb_cObject (*dll_rb_cObject)
214222
# define rb_class_new_instance dll_rb_class_new_instance
@@ -1228,7 +1236,7 @@ static const rb_data_type_t buffer_type = {
12281236
"vim_buffer",
12291237
{0, 0, buffer_dsize,
12301238
# if RUBY_VERSION >= 27
1231-
0, 0
1239+
0, {0}
12321240
# else
12331241
{0, 0}
12341242
# endif
@@ -1508,7 +1516,7 @@ static const rb_data_type_t window_type = {
15081516
"vim_window",
15091517
{0, 0, window_dsize,
15101518
# if RUBY_VERSION >= 27
1511-
0, 0
1519+
0, {0}
15121520
# else
15131521
{0, 0}
15141522
# endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
297,
741743
/**/
742744
296,
743745
/**/

0 commit comments

Comments
 (0)