]> granicus.if.org Git - vim/commitdiff
patch 8.2.0297: compiler warnings for the Ruby interface v8.2.0297
authorBram Moolenaar <Bram@vim.org>
Sat, 22 Feb 2020 14:01:00 +0000 (15:01 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 22 Feb 2020 14:01:00 +0000 (15:01 +0100)
Problem:    Compiler warnings for the Ruby interface.
Solution:   Undefine a few macros, fix initialization. (Ozaki Kiichi,
            closes #5677)

src/if_ruby.c
src/version.c

index f4e1e12394aa85913da96e13688b95d35c1cabaf..a4a59f6bda762767f463b3b89be814af0251324e 100644 (file)
@@ -209,6 +209,14 @@ static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv);
 /*
  * Wrapper defines
  */
+// Ruby 2.7 actually expands the following symbols as macro.
+# if RUBY_VERSION >= 27
+#  undef rb_define_global_function
+#  undef rb_define_method
+#  undef rb_define_module_function
+#  undef rb_define_singleton_method
+# endif
+
 # define rb_assoc_new                  dll_rb_assoc_new
 # define rb_cObject                    (*dll_rb_cObject)
 # define rb_class_new_instance         dll_rb_class_new_instance
@@ -1228,7 +1236,7 @@ static const rb_data_type_t buffer_type = {
     "vim_buffer",
     {0, 0, buffer_dsize,
 # if RUBY_VERSION >= 27
-       0, 0
+       0, {0}
 # else
        {0, 0}
 # endif
@@ -1508,7 +1516,7 @@ static const rb_data_type_t window_type = {
     "vim_window",
     {0, 0, window_dsize,
 # if RUBY_VERSION >= 27
-       0, 0
+       0, {0}
 # else
        {0, 0}
 # endif
index 5eb0d05c980d1da2ce94692001ff810b0dce2c0d..aa9ff36fafa399e6f80bbf8b76c44df063ea18c1 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    297,
 /**/
     296,
 /**/